Merge branch 'master' of github.com:cmcaine/tridactyl into glacambre-make_scrolling_faster

This commit is contained in:
Oliver Blanthorn 2018-05-29 20:34:40 +01:00
commit e745a17b52
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
3 changed files with 74 additions and 15 deletions

View file

@ -47,10 +47,19 @@ install:
#
# Credits: JuliaLang developers.
#
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER `
-and $env:APPVEYOR_BUILD_NUMBER `
-ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds `
- ps: >-
$url = [string]::Format(
"{0}/{1}/{2}/{3}?{4}",
"https://ci.appveyor.com/api/projects",
$env:APPVEYOR_ACCOUNT_NAME,
$env:APPVEYOR_PROJECT_SLUG,
"history",
"recordsNumber=50"
);
`
if ($env:APPVEYOR_PULL_REQUEST_NUMBER `
-and $env:APPVEYOR_BUILD_NUMBER `
-ne ((Invoke-RestMethod $url).builds `
| Where-Object pullRequestId `
-eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) `
{ throw "Newer build in progress, giving this one up ..." }
@ -59,28 +68,30 @@ install:
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
# Verify CWD
- ps: Write-Host "[+] Current working directory is ..."
- ps: Write-Host "[+] Current PowerShell directory is ..."
- ps: Get-Location
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && ls -alh"
# Install Python modules
- ps: python -m pip install --upgrade pip
# - ps: python -m pip install --upgrade packager
- ps: python -m pip install --upgrade pyinstaller
# Install NPM modules
# - bash -e -l -c "cd /C/Tridactyl && npm install -g windows-build-tools"
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && npm install"
build_script:
# Add Python-3.6 to %PATH%
- ps: $env:PATH = "C:\Python36-x64\Scripts;$env:PATH"
- ps: $env:PATH = "C:\Python36-x64;$env:PATH"
- ps: Copy-Item -Path "C:\Python36-x64\Python.exe" -Destination "C:\Python36-x64\Python3.exe"
- ps: >-
Copy-Item `
-Path "C:\Python36-x64\Python.exe" `
-Destination "C:\Python36-x64\Python3.exe"
- python --version
# Install Python modules under Python 3.6
- ps: python -m pip install --upgrade pip>=10.0.1
- ps: python -m pip install --upgrade pyinstaller>=3.3.1
# Change to build directory and verify CWD
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
- ps: Write-Host "[+] Current working directory is ..."
- ps: Write-Host "[+] Current PowerShell directory is ..."
- ps: Get-Location
# Start build
@ -93,3 +104,31 @@ build_script:
- ps: Write-Host "[+] Starting 'npm run build' ..."
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && export PYINSTALLER=1 && npm run build"
test_script:
# Add Python-3.6 to %PATH%
- ps: $env:PATH = "C:\Python36-x64\Scripts;$env:PATH"
- ps: $env:PATH = "C:\Python36-x64;$env:PATH"
- ps: >-
Copy-Item `
-Path "C:\Python36-x64\Python.exe" `
-Destination "C:\Python36-x64\Python3.exe"
- python --version
# Install Python modules under Python 3.6
- ps: python -m pip install --upgrade pip>=10.0.1
- ps: python -m pip install --upgrade pyinstaller>=3.3.1
# Change to build directory and verify CWD
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
- ps: Write-Host "[+] Current PowerShell directory is ..."
- ps: Get-Location
# Start build
- ps: Write-Host "[+] Current %PATH% under Bash ..."
- bash -e -l -c "echo $PATH"
- ps: Write-Host "[+] Current directory under Bash ..."
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && ls -alh"
- ps: Write-Host "[+] Starting 'npm run test' ..."
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && export PYINSTALLER=1 && npm run test"

View file

@ -71,7 +71,7 @@ if (
) {
config.getAsync("newtab").then(newtab => {
if (newtab) {
excmds.open(newtab)
excmds.open_quiet(newtab)
} else {
document.documentElement.style.display = "block"
document.title = "Tridactyl Top Tips & New Tab Page"

View file

@ -778,6 +778,25 @@ export async function open(...urlarr: string[]) {
}
}
/**
* Like [[open]] but doesn't make a new entry in history.
*/
//#content
export async function open_quiet(...urlarr: string[]) {
let url = urlarr.join(" ")
// Setting window.location to about:blank results in a page we can't access, tabs.update works.
if (["about:blank"].includes(url)) {
url = url || undefined
browserBg.tabs.update(await activeTabId(), { url })
// Open URLs that firefox won't let us by running `firefox <URL>` on the command line
} else if (!ABOUT_WHITELIST.includes(url) && url.match(/^(about|file):.*/)) {
Messaging.message("commandline_background", "recvExStr", ["nativeopen " + url])
} else if (url !== "") {
document.location.replace(forceURI(url))
}
}
/** @hidden */
//#content_helper
let sourceElement = undefined
@ -1093,8 +1112,9 @@ export function urlmodify(mode: "-t" | "-r" | "-q" | "-Q" | "-g", ...args: strin
break
}
// TODO: once we have an arg parser, have a quiet flag that prevents the page from being added to history
if (newUrl && newUrl !== oldUrl) {
window.location.href = newUrl
window.location.replace(newUrl)
}
}