Merge branch 'master' into gsbabil/fix-restart-command-on-windows

This commit is contained in:
Babil Golam Sarwar 2018-05-29 12:38:03 +10:00
commit 1f7c042d64
63 changed files with 4964 additions and 1982 deletions

95
.appveyor.yml Normal file
View file

@ -0,0 +1,95 @@
# Build worker image (VM template)
image: Visual Studio 2017
# Build platform, i.e. x86, x64, Any CPU.
platform:
- Any CPU
# Set `git clone` directory
clone_folder: 'C:\Tridactyl'
init:
# Verify %PATH%
- ps: Write-Host "[+] Current PATH contains ..."
- ps: Write-Host $env:PATH.Replace(";", "`r`n")
# Verify Bash
- ps: Write-Host "[+] Location of Bash ..."
- ps: Get-Command -Name 'bash'
# Verify NPM
- ps: Write-Host "[+] Location of NPM ..."
- ps: Get-Command -Name 'npm'
# Verify software versions
- ps: Write-Host "[+] Verifying software verisons ..."
- sh --version
- bash --version
- node --version
- npm --version
#
# Python version will show "2.7" below, which is required to keep
# NPM's 'bunyan' > 'dtrace-provider' modules happy.
# 'Dtrace-provider' needs Python 'gyp' module, which is only
# available for Python-2. We will prepend Python-3.6 to $PATH,
# under 'build_script'.
#
- python --version
install:
#
# If there is a newer build queued for the same PR, cancel this
# one. The AppVeyor 'rollout builds' option is supposed to serve
# the same purpose but it is problematic because it tends to
# cancel builds pushed directly to master instead of just PR
# builds (or the converse).
#
# 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 `
| Where-Object pullRequestId `
-eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) `
{ throw "Newer build in progress, giving this one up ..." }
# Change to build directory
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
# Verify CWD
- ps: Write-Host "[+] Current working 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"
# Change to build directory and verify CWD
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
- ps: Write-Host "[+] Current working 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 build' ..."
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && export PYINSTALLER=1 && npm run build"

5
.gitignore vendored
View file

@ -8,3 +8,8 @@ generated
web-ext-artifacts
yarn.lock
.vscode/
native/__pycache__
native/native_main
native_main.spec
.wine-pyinstaller/
tags

View file

@ -2,355 +2,374 @@
## Release 1.13.0 / Unreleased
- `fixamo` added: you can now use Tridactyl on addons.mozilla.org. Requires a `restart`.
* `fixamo` added: you can now use Tridactyl on addons.mozilla.org. Requires a `restart`.
- `editor` now includes the hostname of the site you are on in the temporary filename
- this is mostly so that you can set up syntax highlighting in Vim, e.g,
- `au BufReadPost *github.com* set syntax=pandoc`
* `editor` now includes the hostname of the site you are on in the temporary filename
- `native` support for Windows: just do what `installnative` tells you to
- you'll probably want to make sure `gvim` is on your path
* this is mostly so that you can set up syntax highlighting in Vim, e.g,
* `au BufReadPost *github.com* set syntax=pandoc`
- **Potentially breaking changes**
- pipes in `composite` now send return values to the following ex command. Use semi-colons if you want the old behaviour back (see `bind D`).
- the `DocStart` now uses `String.prototype.search` for matching, so you can use regular expressions such as `/www\.amazon\.co.*/`
* `native` support for Windows: just do what `installnative` tells you to
- Add internal functions for editing `user.js` - we'll probably add a nice interface to this some day.
* you'll probably want to make sure `gvim` is on your path
- Add `restart` command to restart Firefox.
* **Potentially breaking changes**
- Add new themes
- `shydactyl` and `greenmat`, covering both ends of the design spectrum.
* pipes in `composite` now send return values to the following ex command. Use semi-colons if you want the old behaviour back (see `bind D`).
* the `DocStart` now uses `String.prototype.search` for matching, so you can use regular expressions such as `/www\.amazon\.co.*/`
- Make themes apply to {newtab, mode indicator, tutor}
* Add internal functions for editing `user.js` - we'll probably add a nice interface to this some day.
- Add new internal structure for themes - check out contributing.md on the repository if you want to add your own
- Adding themes at runtime is planned but some way off.
* Add `restart` command to restart Firefox.
* Add new themes
* `shydactyl` and `greenmat`, covering both ends of the design spectrum.
* Make themes apply to {newtab, mode indicator, tutor}
* Add new internal structure for themes - check out contributing.md on the repository if you want to add your own
* Adding themes at runtime is planned but some way off.
## Release 1.12.0 / 2018-05-13
- Add container support
- `hint` will now open links in the current container
- there is a new setting, `set tabopencontaineraware [false|true]`, which will make `tabopen` open new tabs in the current container
- Add extra `<CA-Esc>` bind to toggle ignore mode by popular demand
- Fix errors related to missing native messenger on Firefox launch
* Add container support
* `hint` will now open links in the current container
* there is a new setting, `set tabopencontaineraware [false|true]`, which will make `tabopen` open new tabs in the current container
* Add extra `<CA-Esc>` bind to toggle ignore mode by popular demand
* Fix errors related to missing native messenger on Firefox launch
## Release 1.11.2 / 2018-05-11
- Hotfix to prevent "config undefined" errors on browser start if no rc file was found
- It was mysteriously only reproducible sometimes...
- Make newtab changelog a bit wider
* Hotfix to prevent "config undefined" errors on browser start if no rc file was found
* It was mysteriously only reproducible sometimes...
* Make newtab changelog a bit wider
## Release 1.11.1 / 2018-05-11
- **Add "tridactylrc" support**
- Stick a bunch of commands you want to run at startup in one of:
- `$XDG_CONFIG_DIR/tridactyl/tridactylrc`
- `~/.config/tridactyl/tridactylrc`
- `~/.tridactylrc`
- [Example file available here](https://github.com/cmcaine/tridactyl/blob/master/.tridactylrc)
- You can run any file you want with `source [absolute path to file]`. Bonus points if you can think of something sensible to do with `source` in an `autocmd`.
- If you want vim-style configuration where nothing persists except that which is in the rc file, simply add `sanitise tridactyllocal tridactylsync` to the top of your rc file.
- Only whole-line comments are supported at the moment, in the VimL style where lines start with a quote mark: "
* **Add "tridactylrc" support**
- Native messenger updated to 0.1.3
- Add rc file reader
- Add ability to read environment variables
- Make read understand ~ and environment variables (used in `source`)
* Stick a bunch of commands you want to run at startup in one of:
* `$XDG_CONFIG_DIR/tridactyl/tridactylrc`
* `~/.config/tridactyl/tridactylrc`
* `~/.tridactylrc`
* [Example file available here](https://github.com/cmcaine/tridactyl/blob/master/.tridactylrc)
* You can run any file you want with `source [absolute path to file]`. Bonus points if you can think of something sensible to do with `source` in an `autocmd`.
* If you want vim-style configuration where nothing persists except that which is in the rc file, simply add `sanitise tridactyllocal tridactylsync` to the top of your rc file.
* Only whole-line comments are supported at the moment, in the VimL style where lines start with a quote mark: "
- Readme updated
- Add statistics page and `guiset`
* Native messenger updated to 0.1.3
- Bug fixes
- `guiset` can now cope with multiple Firefox instances running simultaneously provided they are started with profiles explicitly via the command line.
* Add rc file reader
* Add ability to read environment variables
* Make read understand ~ and environment variables (used in `source`)
- Deprecations
- Remove buffers,tabs as promised
- Inform people pressing `I` of the new bind
* Readme updated
* Add statistics page and `guiset`
* Bug fixes
* `guiset` can now cope with multiple Firefox instances running simultaneously provided they are started with profiles explicitly via the command line.
* Deprecations
* Remove buffers,tabs as promised
* Inform people pressing `I` of the new bind
## Release 1.11.0 / 2018-05-09
- You can now edit the Firefox GUI from Tridactyl with `guiset`. You must restart Firefox after using `guiset` to see the effects.
- e.g, `guiset gui none` or `guiset gui full`.
- see all the options with `help guiset` and following the links.
- **Only minimally tested. Back up your precious userChrome.css if you care about it!**
* You can now edit the Firefox GUI from Tridactyl with `guiset`. You must restart Firefox after using `guiset` to see the effects.
- You can now choose to bypass [CSP](https://en.wikipedia.org/wiki/Content_Security_Policy) on all sites with `set csp clobber`. If you change your mind, just `unset csp`, and restart your browser.
- This, for example, allows Tridactyl to run on pages such as https://raw.githubusercontent.com/cmcaine/tridactyl/master/CHANGELOG.md, but it could also allow other scripts to run on pages, making the Internet as dangerous as it was about 2 or 3 years ago before CSP was introduced.
- Once this [bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1267027) in Firefox is fixed, you won't have to clobber CSP.
* e.g, `guiset gui none` or `guiset gui full`.
* see all the options with `help guiset` and following the links.
* **Only minimally tested. Back up your precious userChrome.css if you care about it!**
- Tridactyl will no longer update while the browser is running in an attempt to fix issues where the add-on would be unresponsive after an update; instead, it will only update on browser launch.
- This includes manual updates via `about:addons`. You'll need to restart the browser after clicking "Check for updates".
* You can now choose to bypass [CSP](https://en.wikipedia.org/wiki/Content_Security_Policy) on all sites with `set csp clobber`. If you change your mind, just `unset csp`, and restart your browser.
- `set newtab news.bbc.co.uk` etc. now looks much less janky
* This, for example, allows Tridactyl to run on pages such as https://raw.githubusercontent.com/cmcaine/tridactyl/master/CHANGELOG.md, but it could also allow other scripts to run on pages, making the Internet as dangerous as it was about 2 or 3 years ago before CSP was introduced.
* Once this [bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1267027) in Firefox is fixed, you won't have to clobber CSP.
- Minor new features
- Add !s alias for silent exclaim
- `termite` and `terminator` support with `set editorcmd auto`
- Allow binding <Esc> (not recommended...)
- AMO explains why we need each new permission
- Native messenger documentation improved, making it clear that we haven't reimplemented IRC in the browser.
* Tridactyl will no longer update while the browser is running in an attempt to fix issues where the add-on would be unresponsive after an update; instead, it will only update on browser launch.
- Minor bug fixes
- Remove pixel gap under command bar (#442)
- Native installer no longer requires pip and supports Debian's `which`
- Help page links are more legible on rubbish screens
- Turn 'q' and 'qall' into aliases
- Fix typo regarding binding of special keys on help page
- `focusinput` is now better at finding elements to focus
* This includes manual updates via `about:addons`. You'll need to restart the browser after clicking "Check for updates".
* `set newtab news.bbc.co.uk` etc. now looks much less janky
* Minor new features
* Add !s alias for silent exclaim
* `termite` and `terminator` support with `set editorcmd auto`
* Allow binding <Esc> (not recommended...)
* AMO explains why we need each new permission
* Native messenger documentation improved, making it clear that we haven't reimplemented IRC in the browser.
* Minor bug fixes
* Remove pixel gap under command bar (#442)
* Native installer no longer requires pip and supports Debian's `which`
* Help page links are more legible on rubbish screens
* Turn 'q' and 'qall' into aliases
* Fix typo regarding binding of special keys on help page
* `focusinput` is now better at finding elements to focus
## Release 1.10.1 / 2018-05-04
- Add tabcloseallto{right,left} bound to `gx0` and `gx$`
- Update tab page and other documentation to reflect new ignore mode binding
- Fix #474: you can open a handful of about:* pages without the native messenger again
- Improve feedback when native messenger is not correctly installed
* Add tabcloseallto{right,left} bound to `gx0` and `gx$`
* Update tab page and other documentation to reflect new ignore mode binding
* Fix #474: you can open a handful of about:\* pages without the native messenger again
* Improve feedback when native messenger is not correctly installed
## Release 1.10.0 / 2018-05-03
- Native messenger (for OSX/Linux only, for now)! On Linux/OSXRun `:installnative` to install, then:
- `<Ctrl-I>` in a text field will open Vim, probably. Set it with `set editorcmd` but make sure that the command stays in the foreground till the programme is exited.
- Not all text fields work yet (esp CodeMirror), so make sure you test it before writing war and peace.
- `:! [shell command]` or `:exclaim [shell command]` will run the command and give you STDOUT/STDERR back in the command line.
- You can't use composite and shell pipes together yet.
- Anything that works in `/bin/sh` should work
- If you want to use a different shell, just make your own alias:
- `command ! exclaim fish -c` (but be aware that some shells require quotes around arguments given to -c)
- Requires a new permission to use the native messenger (and to use Tridactyl at all, unfortunately)
- `nativeopen` will try to open a new tab or window using the native messenger. It is used in `{,win,tab}open` automatically when you try to open about:* or file:* URIs.
* Native messenger (for OSX/Linux only, for now)! On Linux/OSXRun `:installnative` to install, then:
- Add `hint -W [exstr]` to execute exstr on hint's href
- `hint -W exclaim_quiet mpv` works particularly well.
* `<Ctrl-I>` in a text field will open Vim, probably. Set it with `set editorcmd` but make sure that the command stays in the foreground till the programme is exited.
* Not all text fields work yet (esp CodeMirror), so make sure you test it before writing war and peace.
* `:! [shell command]` or `:exclaim [shell command]` will run the command and give you STDOUT/STDERR back in the command line.
* You can't use composite and shell pipes together yet.
* Anything that works in `/bin/sh` should work
* If you want to use a different shell, just make your own alias:
* `command ! exclaim fish -c` (but be aware that some shells require quotes around arguments given to -c)
* Requires a new permission to use the native messenger (and to use Tridactyl at all, unfortunately)
* `nativeopen` will try to open a new tab or window using the native messenger. It is used in `{,win,tab}open` automatically when you try to open about:_ or file:_ URIs.
- **Breaking change**: change ignore mode binds to be symmetric and resolve Jupyter conflict
- Ignore mode is now bound to `<S-Insert>` to enter and leave it.
- Previous binds of `I` and `<S-Esc>` are unbound
* Add `hint -W [exstr]` to execute exstr on hint's href
- More scrolling fixes
- `G`/`gg` will now work on more sites
* `hint -W exclaim_quiet mpv` works particularly well.
- Completion improvements
- History completion performance improved
- If you find you are getting worse results than usual, increase `set historyresults` to, e.g, 500.
- Fix #446: you can now edit completions you select with space
- Completions will now pan to show you what you have selected
* **Breaking change**: change ignore mode binds to be symmetric and resolve Jupyter conflict
- Mode indicator is now print friendly (#453)!
* Ignore mode is now bound to `<S-Insert>` to enter and leave it.
* Previous binds of `I` and `<S-Esc>` are unbound
- Fiddled with `help` theme
- We've tried to make it look a bit more like the old Vimperator help pages and have hidden some useless or misleading bits that TypeDoc produced, such as the return values.
* More scrolling fixes
- `viewsource` improved
- Now bound to `gf` by default
- Fix viewsource elem not always covering the whole page
- Remove viewsource elem on spa history changes
* `G`/`gg` will now work on more sites
- Bind help to F1
* Completion improvements
- Changelog changelog:
- Change changelog date format
- Changelog: use standard case: changelog.md -> CHANGELOG.md
- Changelog: move to the standard location
- Changelog: add dates
* History completion performance improved
* If you find you are getting worse results than usual, increase `set historyresults` to, e.g, 500.
* Fix #446: you can now edit completions you select with space
* Completions will now pan to show you what you have selected
- Misc fixes
- Fix :open <empty string>. Fixes #421
- Filter AltGraph keys. Fixes #430
- Explain that the hint tags are typed in lowercase even though they are displayed in uppercase
* Mode indicator is now print friendly (#453)!
* Fiddled with `help` theme
* We've tried to make it look a bit more like the old Vimperator help pages and have hidden some useless or misleading bits that TypeDoc produced, such as the return values.
* `viewsource` improved
* Now bound to `gf` by default
* Fix viewsource elem not always covering the whole page
* Remove viewsource elem on spa history changes
* Bind help to F1
* Changelog changelog:
* Change changelog date format
* Changelog: use standard case: changelog.md -> CHANGELOG.md
* Changelog: move to the standard location
* Changelog: add dates
* Misc fixes
* Fix :open <empty string>. Fixes #421
* Filter AltGraph keys. Fixes #430
* Explain that the hint tags are typed in lowercase even though they are displayed in uppercase
## Release 1.9.8 / 2018-04-26
- Make error reporting to command line less fussy
- Fix error reporting loop with `noiframeon`
* Make error reporting to command line less fussy
* Fix error reporting loop with `noiframeon`
## Release 1.9.7 / 2018-04-25
- Load iframe more lazily to stop breakage on some sites
- Add setting `noiframeon` for websites that are still broken by our iframe ("ServiceNow", for example: #279)
- Simply `set noiframeon [space separated URLs]` to blacklist URLs
- This will hopefully be our final release before the native messenger for OSX and Linux is merged.
- If you'd like to help test it out, download our latest betas from [here](https://tridactyl.cmcaine.co.uk/betas) and run `:installnative` once you are in.
* Load iframe more lazily to stop breakage on some sites
* Add setting `noiframeon` for websites that are still broken by our iframe ("ServiceNow", for example: #279)
* Simply `set noiframeon [space separated URLs]` to blacklist URLs
* This will hopefully be our final release before the native messenger for OSX and Linux is merged.
* If you'd like to help test it out, download our latest betas from [here](https://tridactyl.cmcaine.co.uk/betas) and run `:installnative` once you are in.
## Release 1.9.6 / 2018-04-25
- Scrolling improvements
- Faster (#395)
- `G`/`gg` work on more pages (#382)
- Mode indicator improvements
- Can be disabled with `set modeindicator false`
- Text is not selectable to improve the lives of people who "Select All" a lot
- Internal error messages are now displayed in the command line
- New default alias `:h` for `:help`
- Bug fixes
- Fix #418: keyseq is better at realising when a key combination is invalid
* Scrolling improvements
* Faster (#395)
* `G`/`gg` work on more pages (#382)
* Mode indicator improvements
* Can be disabled with `set modeindicator false`
* Text is not selectable to improve the lives of people who "Select All" a lot
* Internal error messages are now displayed in the command line
* New default alias `:h` for `:help`
* Bug fixes
* Fix #418: keyseq is better at realising when a key combination is invalid
## Release 1.9.5 / 2018-04-22
- Add mode indicator
- Fix #337: Make `composite` and ex-parser more sequential
- Add `D` binding: close current tab and `tabprev`
- Bug fixes
- Fix `tab` in inputmode
- Catch CSP exception when hijacking
* Add mode indicator
* Fix #337: Make `composite` and ex-parser more sequential
* Add `D` binding: close current tab and `tabprev`
* Bug fixes
* Fix `tab` in inputmode
* Catch CSP exception when hijacking
## Release 1.9.4 / 2018-04-20
- Add jumplist for inputs bound to `g;`
- Editor's impartial note: this is pretty cool
- Add `hint -W [exstr]` to execute exstr on hint's href
- Update new tab page:
- Add changelog
- Remove welcome to new users as we have `tutor` for that now
- Fix newtab redirection on `set newtab [url]`
- `set newtab about:blank` now works thanks to a Mozilla bug fix!
- Warn users about native messenger update
- Bug fixes
- input-mode now correctly exits to normal mode on focus loss
- Stop treating "std::map" or "Error: foo" as URIs: searching for them will now work.
* Add jumplist for inputs bound to `g;`
* Editor's impartial note: this is pretty cool
* Add `hint -W [exstr]` to execute exstr on hint's href
* Update new tab page:
* Add changelog
* Remove welcome to new users as we have `tutor` for that now
* Fix newtab redirection on `set newtab [url]`
* `set newtab about:blank` now works thanks to a Mozilla bug fix!
* Warn users about native messenger update
* Bug fixes
* input-mode now correctly exits to normal mode on focus loss
* Stop treating "std::map" or "Error: foo" as URIs: searching for them will now work.
## Release 1.9.3 / 2018-04-19
- Fix unbind issues
- Add more default binds from Vimperator
- Change the `^` bind to `<c-6>` (matches vim)
- :bmark now supports folders
* Fix unbind issues
* Add more default binds from Vimperator
* Change the `^` bind to `<c-6>` (matches vim)
* :bmark now supports folders
## Release 1.9.2 / 2018-04-16
- Fix #392 (bug with keyseq)
* Fix #392 (bug with keyseq)
## Release 1.9.1 / 2018-04-15
- Fix buffer switch bind
* Fix buffer switch bind
## Release 1.9.0 / 2018-04-15
- Allow binds with modifiers (e.g. `<C-u>`) and binds of special keys (e.g. `<F1>`) and both together (e.g. `<SA-Escape>`)
- Normal mode now only hides keypresses that you've told it to listen to from the web page
- Improve documentation
- Update readme
- Improve help on excmds.ts
- Update AMO text (includes explanation of why various permissions are demanded)
- Add tutorial on `tutor`
- Shown on first install of Tridactyl
- Add `viewconfig` command to open the current configuration in Firefox's native JSON viewer (which Tridactyl doesn't work in)
- [Move betas to our own site](https://tridactyl.cmcaine.co.uk/betas) as addons.mozilla.org stopped supporting them (#307)
- Add automatic updates for betas
- If you downloaded a beta before pre778, you will need to update manually to a later beta.
- Small new features
- Fix #370: add `clipboard yanktitle|yankmd`
- Add `fullscreen` command (not quite #376)
- Add `viewsource` command
- `set allowautofocus false` to stop pages stealing focus on load (#266, #369)
- `^` now switches to last used tab by default
- In command mode, `Space` now puts the URL from the selected completion into the command line (#224)
- Add find mode, left unbound by default
- Not ready for widespread usage: slow and probably buggy.
- `hint -wp` to open hint in a private window (#317)
- Configuration can now upgrade itself to allow us to rename settings
- Add dark theme: `set theme dark` (#230)
- Tab opening settings for `tabopen` (#342)
- `set {related,tab}openpos next|last`
- Stuff only collaborators will care about
- Code is now run through the prettier formatter before each commit
- Moderately large bug fixes
- Fix scrolling on sites that use frames (#372, #63, #107, #273, #218)
- Fix hinting on sites with frames (#67)
- Hijack event listeners to put hints on more JavaScript links (#204, #163, #215)
- Small bug fixes
- Fix #276: ]] on Hacker News
- Support #/% index for tabs everywhere internally
- Fix #341: `tabclose #` now works
- Reduce logging
- Rename some config:
- Rename vimium-gi to gimode, default to firefox, version to configversion
- Fix hinting following JavaScript links because they look the same
- Introduce new bugs
- Show useless hints on some sites (#225)
- and more!
* Allow binds with modifiers (e.g. `<C-u>`) and binds of special keys (e.g. `<F1>`) and both together (e.g. `<SA-Escape>`)
* Normal mode now only hides keypresses that you've told it to listen to from the web page
* Improve documentation
* Update readme
* Improve help on excmds.ts
* Update AMO text (includes explanation of why various permissions are demanded)
* Add tutorial on `tutor`
* Shown on first install of Tridactyl
* Add `viewconfig` command to open the current configuration in Firefox's native JSON viewer (which Tridactyl doesn't work in)
* [Move betas to our own site](https://tridactyl.cmcaine.co.uk/betas) as addons.mozilla.org stopped supporting them (#307)
* Add automatic updates for betas
* If you downloaded a beta before pre778, you will need to update manually to a later beta.
* Small new features
* Fix #370: add `clipboard yanktitle|yankmd`
* Add `fullscreen` command (not quite #376)
* Add `viewsource` command
* `set allowautofocus false` to stop pages stealing focus on load (#266, #369)
* `^` now switches to last used tab by default
* In command mode, `Space` now puts the URL from the selected completion into the command line (#224)
* Add find mode, left unbound by default
* Not ready for widespread usage: slow and probably buggy.
* `hint -wp` to open hint in a private window (#317)
* Configuration can now upgrade itself to allow us to rename settings
* Add dark theme: `set theme dark` (#230)
* Tab opening settings for `tabopen` (#342)
* `set {related,tab}openpos next|last`
* Stuff only collaborators will care about
* Code is now run through the prettier formatter before each commit
* Moderately large bug fixes
* Fix scrolling on sites that use frames (#372, #63, #107, #273, #218)
* Fix hinting on sites with frames (#67)
* Hijack event listeners to put hints on more JavaScript links (#204, #163, #215)
* Small bug fixes
* Fix #276: ]] on Hacker News
* Support #/% index for tabs everywhere internally
* Fix #341: `tabclose #` now works
* Reduce logging
* Rename some config:
* Rename vimium-gi to gimode, default to firefox, version to configversion
* Fix hinting following JavaScript links because they look the same
* Introduce new bugs
* Show useless hints on some sites (#225)
* and more!
## Release 1.8.2 / 2018-03-07
- Improve config API
- `set key.subkey.subsubkey value` now works
- Add user feedback to `bind` and `get`
- Add save link/img hint submode (;s, ;S, ;a, ;A) (#148)
- Add `autocmd [event] [filter] [ex command]`
- Currently, only supports the event `DocStart`
- Most useful for entering ignore mode on certain websites: `autocmd DocStart mail.google.com mode ignore`
- Add exmode aliases with `command [alias] [ex_command]`. Many aliases have been ported from Pentadactyl. (#236)
- Add urlmodify command (#286, #298)
- Support Emacs-style C-(a|e|k|u) in cmdline (#277)
- Support changing followpage pattern used in `]]` and `[[` to allow use with foreign languages
- Add logging levels and make logging less verbose by default (#206)
- Support %s magic string for search providers (#253)
- Add hintfiltermode config and new "vimperator, vimperator-reflow" hinting modes
- Make hintPage follow link if there's only 1 option
- Fix high resource usage when typing under some circumstances (#311)
- `set newtab foo.bar` now changes all new tab pages (#235)
- Fix hints on some sites via cleanslate.css (#220)
- Fix new config system (#321)
- followpage now falls back to urlincrement
- `tabopen` now opens tabs to the right of the current tab
- Fix floating commandline iframe on some sites (#289)
- Enter insert mode on drop down menus (#281)
- Support hinting on some dodgy old websites (#287)
- Make :reloadall only refresh current window tabs (#288)
- Remove `xx` binding (#262)
- Fix gu in directories (#256)
- Fix various typos (#247, #228)
- Add FAQ and other updates to readme.md (#232)
* Improve config API
* `set key.subkey.subsubkey value` now works
* Add user feedback to `bind` and `get`
* Add save link/img hint submode (;s, ;S, ;a, ;A) (#148)
* Add `autocmd [event] [filter] [ex command]`
* Currently, only supports the event `DocStart`
* Most useful for entering ignore mode on certain websites: `autocmd DocStart mail.google.com mode ignore`
* Add exmode aliases with `command [alias] [ex_command]`. Many aliases have been ported from Pentadactyl. (#236)
* Add urlmodify command (#286, #298)
* Support Emacs-style C-(a|e|k|u) in cmdline (#277)
* Support changing followpage pattern used in `]]` and `[[` to allow use with foreign languages
* Add logging levels and make logging less verbose by default (#206)
* Support %s magic string for search providers (#253)
* Add hintfiltermode config and new "vimperator, vimperator-reflow" hinting modes
* Make hintPage follow link if there's only 1 option
* Fix high resource usage when typing under some circumstances (#311)
* `set newtab foo.bar` now changes all new tab pages (#235)
* Fix hints on some sites via cleanslate.css (#220)
* Fix new config system (#321)
* followpage now falls back to urlincrement
* `tabopen` now opens tabs to the right of the current tab
* Fix floating commandline iframe on some sites (#289)
* Enter insert mode on drop down menus (#281)
* Support hinting on some dodgy old websites (#287)
* Make :reloadall only refresh current window tabs (#288)
* Remove `xx` binding (#262)
* Fix gu in directories (#256)
* Fix various typos (#247, #228)
* Add FAQ and other updates to readme.md (#232)
## Release 1.7.3 / 2017-12-21
- Hint tags are much better:
- Hint tags are now as short as possible
- Remove now disused `hintorder` setting
- Add `.` to repeat last action
- Add inputmode: `gi` and then `Tab` will cycle you between all input fields on a page
- Add hint kill submode `;k` for removing elements of a webpage such as dickbars
- Add relative zoom and `z{i,z,o}` binds
- Add `sanitize` excmd for deleting browsing/Tridactyl data
- Search engines:
- Add `searchsetkeyword [keyword] [url]`: define your own search engines (#194)
- Add Qwant and update startpage URL (#198)
- Add Google Scholar search engine
- Fix problems where ignore mode would revert to normal mode on some websites with iframes (#176)
- Add ^ and $ in normal mode for navigation to 0% or 100% in x-direction
- Buffer completion fixes
- Use tab ID even if buffer has a trailing space (#223)
- completions: passthrough # in buffercompletion
- Support multiple URLs for quickmarks
- Blacklist default newtab url from history completions
- Fix `set newtab` failing to set newtab
- Add `q`, `qa`, and `quit` synonyms
- Fix `unset` failing to take effect without reloading page
- Minor improvements to `help` preface
- Add <summary> tags to standard hinting
- Log an error to browser console if no TTS voices are found
* Hint tags are much better:
* Hint tags are now as short as possible
* Remove now disused `hintorder` setting
* Add `.` to repeat last action
* Add inputmode: `gi` and then `Tab` will cycle you between all input fields on a page
* Add hint kill submode `;k` for removing elements of a webpage such as dickbars
* Add relative zoom and `z{i,z,o}` binds
* Add `sanitize` excmd for deleting browsing/Tridactyl data
* Search engines:
* Add `searchsetkeyword [keyword] [url]`: define your own search engines (#194)
* Add Qwant and update startpage URL (#198)
* Add Google Scholar search engine
* Fix problems where ignore mode would revert to normal mode on some websites with iframes (#176)
* Add ^ and $ in normal mode for navigation to 0% or 100% in x-direction
* Buffer completion fixes
* Use tab ID even if buffer has a trailing space (#223)
* completions: passthrough # in buffercompletion
* Support multiple URLs for quickmarks
* Blacklist default newtab url from history completions
* Fix `set newtab` failing to set newtab
* Add `q`, `qa`, and `quit` synonyms
* Fix `unset` failing to take effect without reloading page
* Minor improvements to `help` preface
* Add <summary> tags to standard hinting
* Log an error to browser console if no TTS voices are found
## Release 1.7.0 / 2017-12-01
- History completion is massively improved: much faster, more relevant results, and less janky as you type.
- User configuration
- set [setting] without a value will inform you of the current value
- Add configuration options for hinting: `hintchars` and `hintorder`
- Add unset for resetting a bind to default
- You can now change default search engine with e.g, `set searchengine bing` (#60)
- The default new tab page can be replaced with any URL via `set newtab [url]` (#59)
- Add `gh` and `gH` and "homepages" setting (#96)
- Shift-tab and tab now will cycle around completions correctly
- `ys` now works on some older pages
- Add bmarks command for searching through bookmarks (#167)
- Add `hint -c [selector]`: add hints that match CSS selector
- Add text-to-speech hint mode on `;r`
- Allow `;p` to yank any element which contains text
- Add `;#` hint yank anchor mode
- Improve hint CSS by adding a border and making background semi-transparent
- Add `tabonly` command
- Fix hinting mysteriously not working on some pages (#168)
- Fix issue where command line would invisibly cover up part of the screen (#170)
- Bookmarks can now have spaces in their titles
- Fix some hints on sites such as pcgamer.co.uk
- Long page titles will no longer appear after URLs in completions
* History completion is massively improved: much faster, more relevant results, and less janky as you type.
* User configuration
* set [setting] without a value will inform you of the current value
* Add configuration options for hinting: `hintchars` and `hintorder`
* Add unset for resetting a bind to default
* You can now change default search engine with e.g, `set searchengine bing` (#60)
* The default new tab page can be replaced with any URL via `set newtab [url]` (#59)
* Add `gh` and `gH` and "homepages" setting (#96)
* Shift-tab and tab now will cycle around completions correctly
* `ys` now works on some older pages
* Add bmarks command for searching through bookmarks (#167)
* Add `hint -c [selector]`: add hints that match CSS selector
* Add text-to-speech hint mode on `;r`
* Allow `;p` to yank any element which contains text
* Add `;#` hint yank anchor mode
* Improve hint CSS by adding a border and making background semi-transparent
* Add `tabonly` command
* Fix hinting mysteriously not working on some pages (#168)
* Fix issue where command line would invisibly cover up part of the screen (#170)
* Bookmarks can now have spaces in their titles
* Fix some hints on sites such as pcgamer.co.uk
* Long page titles will no longer appear after URLs in completions

View file

@ -6,42 +6,39 @@ Tridactyl is very lucky to have a wide base of contributors, 30 at the time of w
### Quick tasks (~10 minutes)
- Leave a review on [addons.mozilla.org][amoreviews] (very few people do this :( )
- Tell your friends about us :)
- Read through [readme.md][readme], our [newtab.md][newtab] or our page on [addons.mozilla.org][amo] and see if anything looks out of date. If it does, file an issue or fork the repository (button in top right), fix it yourself (you can edit it using the pencil icon), and make a pull request.
* Leave a review on [addons.mozilla.org][amoreviews] (very few people do this :( )
* Tell your friends about us :)
* Read through [readme.md][readme], our [newtab.md][newtab] or our page on [addons.mozilla.org][amo] and see if anything looks out of date. If it does, file an issue or fork the repository (button in top right), fix it yourself (you can edit it using the pencil icon), and make a pull request.
### Quick tasks (~30 minutes)
- Run through `:tutor` and [tell us what you think][tutor] or make changes directly.
* Run through `:tutor` and [tell us what you think][tutor] or make changes directly.
## Programming (1 hour+)
- Take a look through the [open issues][issues] and then check with [pull requests][prs] to make sure that someone isn't already working on it. Please post in an issue to say that you're working on it.
- If you don't have much experience with JavaScript or WebExtensions, we purposefully leave some particularly simple issues open so that people can get started, and give them the tag [good first issue][easyissues]. Feel free to ask us any questions about the build process on [Matrix][Matrix].
- If you have experience with JavaScript or WebExtensions, please look through the issues tagged [help wanted][helpus] as we're really stuck on them.
- You could work on some feature that you really want to see in Tridactyl that we haven't even thought of yet.
- Our build process is a bit convoluted, but [excmds.ts][excmds] is probably where you want to start. Most of the business happens there.
- We use TypeDoc to produce the `:help` page. Look at the other functions in [excmds.ts][excmds] to get an idea of how to use it; if your function is not supposed to called from the command line, then please add `/** @hidden */` above it to prevent it being shown on the help page.
- Our pre-commit hook runs prettier to format your code. Please don't circumvent it.
* Take a look through the [open issues][issues] and then check with [pull requests][prs] to make sure that someone isn't already working on it. Please post in an issue to say that you're working on it.
* If you don't have much experience with JavaScript or WebExtensions, we purposefully leave some particularly simple issues open so that people can get started, and give them the tag [good first issue][easyissues]. Feel free to ask us any questions about the build process on [Matrix][matrix].
* If you have experience with JavaScript or WebExtensions, please look through the issues tagged [help wanted][helpus] as we're really stuck on them.
* You could work on some feature that you really want to see in Tridactyl that we haven't even thought of yet.
* Our build process is a bit convoluted, but [excmds.ts][excmds] is probably where you want to start. Most of the business happens there.
* We use TypeDoc to produce the `:help` page. Look at the other functions in [excmds.ts][excmds] to get an idea of how to use it; if your function is not supposed to called from the command line, then please add `/** @hidden */` above it to prevent it being shown on the help page.
* Our pre-commit hook runs prettier to format your code. Please don't circumvent it.
If you are making a substantial or potentially controversial change, your first port of call should be to stop by and chat to us on [Matrix][Matrix] or file an issue to discuss what you would like to change. We really don't want you to waste time on a pull request (GitHub jargon for a contribution) that has no chance of being merged; that said, we are probably happy to gate even the most controversial changes behind an option.
If you are making a substantial or potentially controversial change, your first port of call should be to stop by and chat to us on [Matrix][matrix] or file an issue to discuss what you would like to change. We really don't want you to waste time on a pull request (GitHub jargon for a contribution) that has no chance of being merged; that said, we are probably happy to gate even the most controversial changes behind an option.
# Add another theme (30 minutes+)
Take a look in src/static/themes to get an idea of what to do. There is a reasonable amount of magic going on:
- All of your styles must be prefixed with `:root.TridactylTheme[Name]`. If your theme is called `bobstheme`, the selector mentioned must be `:root.TridactylThemeBobstheme` (note the capitalisation).
- All of your CSS will be injected into all pages, so it is important that is fenced off in this manner.
- `default.css` has loads of variables that you can use to make it easier for you to style things, and for your theme to apply to new elements that did not exist when you wrote your theme. It is advised that you make as much use of these as possible.
* All of your styles must be prefixed with `:root.TridactylTheme[Name]`. If your theme is called `bobstheme`, the selector mentioned must be `:root.TridactylThemeBobstheme` (note the capitalisation).
* All of your CSS will be injected into all pages, so it is important that is fenced off in this manner.
* `default.css` has loads of variables that you can use to make it easier for you to style things, and for your theme to apply to new elements that did not exist when you wrote your theme. It is advised that you make as much use of these as possible.
# Code of conduct
[Queensberry rules](https://en.oxforddictionaries.com/definition/queensberry_rules).
[Matrix]: https://riot.im/app/#/room/#tridactyl:matrix.org
[matrix]: https://riot.im/app/#/room/#tridactyl:matrix.org
[issues]: https://github.com/cmcaine/tridactyl/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+
[easyissues]: https://github.com/cmcaine/tridactyl/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[helpus]: https://github.com/cmcaine/tridactyl/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22

View file

@ -1,86 +1,58 @@
## Control your browser with your keyboard *only*.
## Control your browser with your keyboard _only_.
Replace Firefox's control mechanism with one modelled on VIM. This is a "Firefox Quantum" replacement for VimFX, Vimperator and Pentadactyl.
Most common tasks you want your browser to perform are bound to a single key
press:
Replace Firefox's control mechanism with one modelled on VIM. This is a "Firefox Quantum" replacement for VimFX, Vimperator and Pentadactyl. Most common tasks you want your browser to perform are bound to a single key press:
- You want to open a new tab? Hit `t`.
- You want to follow that link? Hit `f` and type the displayed label.
- You want to go to the bottom of the page? Hit `G`. Or the top? `gg`.
- You want to focus the text field on Wikipedia to search for another term? `gi`.
- Switch to the next tab? `gt`.
- Go back in time? `H`.
- Notice that this tab is rubbish and you want to close it? `d`.
- Regret that decision? `u` restores it.
- Want to write something in Vim? `Ctrl-i` in a text box opens it in Vim, if
you have `:native` working.
- Temporarily disable all that magic because you can't stand it? `Shift-Insert`.
- But how do you use your browser now? `Shift-Insert` again and we're back on.
* You want to open a new tab? Hit `t`.
* You want to follow that link? Hit `f` and type the displayed label. (Note: hint characters should be typed in lowercase.)
* You want to go to the bottom of the page? Hit `G`. Or the top? `gg`.
* You want to focus the text field on Wikipedia to search for another term? `gi`.
* Switch to the next tab? `gt`.
* Go back in time? `H`.
* Notice that this tab is rubbish and you want to close it? `d`.
* Regret that decision? `u` restores it.
* Want to write something in Vim? `Ctrl-i` in a text box opens it in Vim, if you have `:native` working.
* Temporarily disable all that magic because you can't stand it? `Shift-Insert`.
* But how do you use your browser now? `Shift-Insert` again and we're back on.
The list could go on a bit here, but I guess you'll get the point. If you feel
lost sometimes `:help` might help you a lot, and there's always `:tutor`.
The list could go on a bit here, but I guess you'll get the point. If you feel lost sometimes `:help` might help you a lot, and there's always `:tutor`.
**Highlighted features:**
- follow any link on the site with just 2-3 key presses.
- switch to any open tab by searching for its URL or title or entering its ID.
- easy customizable search settings
- bind any supported command or commands to the key (sequence) of your liking
- great default bindings (if you're used to Pentadactyl or Vimperator)
* follow any link on the site with just 2-3 key presses.
* switch to any open tab by searching for its URL or title or entering its ID.
* easy customizable search settings
* bind any supported command or commands to the key (sequence) of your liking
* great default bindings (if you're used to Pentadactyl or Vimperator)
This add-on is very usable, but is in an early stage of development. We intend
to implement the majority of Vimperator's features.
This add-on is very usable, but is in an early stage of development. We intend to implement the majority of Vimperator's features.
You can get beta builds from [our website][betas].
**Permissions:**
Since Tridactyl aims to provide all the features Vimperator and Pentadactyl
had, it requires quite a few permissions. Here we describe the specific
permissions and why we need them.
Since Tridactyl aims to provide all the features Vimperator and Pentadactyl had, it requires quite a few permissions. Here we describe the specific permissions and why we need them.
- Access your data for all websites:
* This is Mozilla's way of saying that Tridactyl can read the content of web
pages. This is necessary in order to e.g. find the links you can follow
with the `:hint` command (bound to `f` by default).
- Exchange messages with programs other than Firefox
* This permission is required for Tridactyl to interact with your
operating system (opening your editor to edit text areas, sending links to
your video player, reading a configuration file from your disk...). This
is possible thanks to an external executable we provide. If you feel this
gives Tridactyl too much power you can chose not to install the external
executable: Tridactyl will still work but won't be able to start external
programs.
- Read and modify bookmarks:
* Tridactyl's command line has a powerful autocompletion mechanism. In
order to be able to autocomplete your bookmarks, Tridactyl needs to read
them.
- Clear recent browsing history, cookies, and related data:
* Tridactyl implements the `:sanitise` command Vimperator and Pentadactyl
had. It works a bit like the "Clear All History" dialog you can access by
pressing `Ctrl+Shift+Del` on default Firefox.
- Get data from the clipboard:
* If your clipboard contains a URL, pressing `p` will make Tridactyl follow
this URL in the current tab.
- Input data to the clipboard:
* Tridactyl lets you copy various elements to the clipboard such as a page's
URL with `yy`, a link's URL with `;y` or the content of an HTML element
with `;p`.
- Download files and read and modify the browser's download history:
* By pressing `;s`, `;S`, `;a` and `;A` you can save documents and pictures
from a page to your download folder.
- Access browsing history:
* The URLs of websites you've visited previously can be suggested as
arguments for `:tabopen` and similar commands.
- Access recently closed tabs:
* If you've accidentally closed a tab or window, Tridactyl will let you open
it again with the `:undo` command which is bound to `u` by default.
- Access browser tabs:
* Tridactyl provides a quick tab-switching menu/command with the `:buffer`
command (bound to `b`). This permission is also required to close, move,
and pin tabs, amongst other things.
- Access browser activity during navigation:
* This is needed for Tridactyl to be able to go back to normal mode every
time you open a new page. In the future we may use it for autocommands.
* Access your data for all websites:
* This is Mozilla's way of saying that Tridactyl can read the content of web pages. This is necessary in order to e.g. find the links you can follow with the `:hint` command (bound to `f` by default).
* Exchange messages with programs other than Firefox
* This permission is required for Tridactyl to interact with your operating system (opening your editor to edit text areas, sending links to your video player, reading a configuration file from your disk...). This is possible thanks to an external executable we provide. If you feel this gives Tridactyl too much power you can chose not to install the external executable: Tridactyl will still work but won't be able to start external programs.
* Read and modify bookmarks:
* Tridactyl's command line has a powerful autocompletion mechanism. In order to be able to autocomplete your bookmarks, Tridactyl needs to read them.
* Clear recent browsing history, cookies, and related data:
* Tridactyl implements the `:sanitise` command Vimperator and Pentadactyl had. It works a bit like the "Clear All History" dialog you can access by pressing `Ctrl+Shift+Del` on default Firefox.
* Get data from the clipboard:
* If your clipboard contains a URL, pressing `p` will make Tridactyl follow this URL in the current tab.
* Input data to the clipboard:
* Tridactyl lets you copy various elements to the clipboard such as a page's URL with `yy`, a link's URL with `;y` or the content of an HTML element with `;p`.
* Download files and read and modify the browser's download history:
* By pressing `;s`, `;S`, `;a` and `;A` you can save documents and pictures from a page to your download folder.
* Access browsing history:
* The URLs of websites you've visited previously can be suggested as arguments for `:tabopen` and similar commands.
* Access recently closed tabs:
* If you've accidentally closed a tab or window, Tridactyl will let you open it again with the `:undo` command which is bound to `u` by default.
* Access browser tabs:
* Tridactyl provides a quick tab-switching menu/command with the `:buffer` command (bound to `b`). This permission is also required to close, move, and pin tabs, amongst other things.
* Access browser activity during navigation:
* This is needed for Tridactyl to be able to go back to normal mode every time you open a new page. In the future we may use it for autocommands.
[betas]: https://tridactyl.cmcaine.co.uk/betas/?sort=time&order=desc

View file

@ -11,7 +11,6 @@ A broad outline is thus:
5. This `ex` string is sent to the `ex str` parser, and converted into an internal Tridactyl function, e.g. `commmands.scrollPage(1)`, or if not possible, we report an error to the user
6. These functions then interface with the WebExtensions API and will hide any message passing that needs to occur. If the function fails, it reports an error as in step 5.
browser -> keyEvents -> parser picker -> mode parser -> terminal character -> ex command -> "ex str" parser -> (function | error) -> browser
The process for "BrowserEvents", which occur when the user or some other code manipulates the browser through some non-Tridactyl method is similar, but we skip the parser picker step for now.

View file

@ -85,7 +85,7 @@ Improvements over vimperator:
## Architecture
*This is an early draft and may be entirely replaced.*
_This is an early draft and may be entirely replaced._
ex-commands as functions (typed and with helper functions in some other scope):

View file

@ -2,7 +2,6 @@
See also [content-scripts-bug.md](content-scripts-bug.md).
Vimperator and pentadactyl are addons that replace most of the Firefox UX with a keyboard-focused interface inspired by Vim. They enjoy moderate popularity and are particularly highlighted as "interesting add-ons" for porting on the Mozilla wiki[0].
From now on I'll just say "Vimperator" instead of "Vimperator and pentadactyl" or similar.

View file

@ -2,37 +2,40 @@
Useful workarounds and methods to get the power we want in the brave new world of webextensions.
- Function in newtab
- [chrome_url_overrides](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/chrome_url_overrides)
- Function in home page
- [chrome_settings_overrides](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/chrome_settings_overrides)
- (Downside for both is that we need to reimplement a useful home and newtab page)
* Function in newtab
* [chrome_url_overrides](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/chrome_url_overrides)
* Function in home page
* [chrome_settings_overrides](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/chrome_settings_overrides)
* (Downside for both is that we need to reimplement a useful home and newtab page)
- Shell and write access to filesystem
- [Native_messaging](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging)
- Hiding firefox chrome
- API proposal for hiding tabstrip (but not nav bar): [Bug 1332447](https://api-dev.bugzilla.mozilla.org/show_bug.cgi?id=1332447)
- :Gijs discusses why nav bar can't be hidden, but I still don't get why whatever happens in fullscreen can't just also happen in windowed mode.
- Hiding with userChrome.css
- http://kb.mozillazine.org/Chrome_element_names_and_IDs
- e.g. "#tabbrowser-tabs { visibility: collapse !important; }"
- requires restart, probably
* Shell and write access to filesystem
* [Native_messaging](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging)
* Hiding firefox chrome
- Commandline thru toolbar API
- [Bug 1215064](https://bugzilla.mozilla.org/show_bug.cgi?id=1215064)
- As currently envisioned, size is fixed, I think
- Commandline thru HTML injection into webcontent
- Dangerous, see [Bug 1287590](https://bugzilla.mozilla.org/show_bug.cgi?id=1287590)
- Shadow DOM would probably be simpler than iframe, but not implemented yet [Bug 1205323](https://bugzilla.mozilla.org/show_bug.cgi?id=1205323)
- Commandline thru search suggestions on the omnibar (this is a bit mad)
- [chrome_settings_overrides](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/chrome_settings_overrides)
* API proposal for hiding tabstrip (but not nav bar): [Bug 1332447](https://api-dev.bugzilla.mozilla.org/show_bug.cgi?id=1332447)
* :Gijs discusses why nav bar can't be hidden, but I still don't get why whatever happens in fullscreen can't just also happen in windowed mode.
* Hiding with userChrome.css
* http://kb.mozillazine.org/Chrome_element_names_and_IDs
* e.g. "#tabbrowser-tabs { visibility: collapse !important; }"
* requires restart, probably
- [Find API](https://bug1332144.bmoattachments.org/attachment.cgi?id=8905651)
- [Bug 1332144](https://bugzilla.mozilla.org/show_bug.cgi?id=1332144)
- [Demo](https://github.com/Allasso/Find_API_demo_WE_advanced)
- How to replicate find links? Do we care?
- Can this be used to exfiltrate info about about pages?
* Commandline thru toolbar API
* [Bug 1215064](https://bugzilla.mozilla.org/show_bug.cgi?id=1215064)
* As currently envisioned, size is fixed, I think
* Commandline thru HTML injection into webcontent
* Dangerous, see [Bug 1287590](https://bugzilla.mozilla.org/show_bug.cgi?id=1287590)
* Shadow DOM would probably be simpler than iframe, but not implemented yet [Bug 1205323](https://bugzilla.mozilla.org/show_bug.cgi?id=1205323)
* Commandline thru search suggestions on the omnibar (this is a bit mad)
- Can't navigate to restricted URLs
- [about:](https://bugzilla.mozilla.org/show_bug.cgi?id=1371793)
- [file:](https://bugzilla.mozilla.org/show_bug.cgi?id=1266960)
* [chrome_settings_overrides](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/chrome_settings_overrides)
* [Find API](https://bug1332144.bmoattachments.org/attachment.cgi?id=8905651)
* [Bug 1332144](https://bugzilla.mozilla.org/show_bug.cgi?id=1332144)
* [Demo](https://github.com/Allasso/Find_API_demo_WE_advanced)
* How to replicate find links? Do we care?
* Can this be used to exfiltrate info about about pages?
* Can't navigate to restricted URLs
* [about:](https://bugzilla.mozilla.org/show_bug.cgi?id=1371793)
* [file:](https://bugzilla.mozilla.org/show_bug.cgi?id=1266960)

View file

@ -1,14 +1,14 @@
## Components
- Iterable of visible links on page
* Iterable of visible links on page
- Algorithm for choosing hint characters for each link
* Algorithm for choosing hint characters for each link
- Mode for controller and excmd to refine and select hints:
- I imagine `:hint` to start
- `:hint j` to refine to only hints starting with j
- `:hint jk` to refine to hints starting with jk
- To make maps easier we can have `:hintaddchar j` and have the state of the current hintstr stored content-side.
* Mode for controller and excmd to refine and select hints:
* I imagine `:hint` to start
* `:hint j` to refine to only hints starting with j
* `:hint jk` to refine to hints starting with jk
* To make maps easier we can have `:hintaddchar j` and have the state of the current hintstr stored content-side.
## Improvements

View file

@ -2,73 +2,60 @@
Vimperator is going to die once Firefox deprecates XUL and switches webextensions. Needs fixing, or nobody will be able to use the internet any more.
Valiant efforts have been begun to sort out some parts of Firefox's WebExtension implementation:
https://bugzilla.mozilla.org/show_bug.cgi?id=1215061
Valiant efforts have been begun to sort out some parts of Firefox's WebExtension implementation: https://bugzilla.mozilla.org/show_bug.cgi?id=1215061
This only deals with the keyboard binding aspect. We need to think about the GUI / hinting etc: we need to make sure everything we want to have in Vimperator is possible using WebExtensions.
Chrome et al. already use WebExtensions, and there are a few vim-like extensions for it, such as cVim/Vimium. It would make sense to look at how these extensions work and see what is not currently possible in Firefox. An obvious part of what they cannot do is change the GUI of the browser. Vimperator allows you to hide parts of the browser when they are not needed.
It would also be sensible to have a list of ideal things that can't currently be done in Vimperator, e.g. embedding Vim client, that we would like. (look at Petrosaur)
There is currently a magic console in Firefox that we could perhaps hijack, which is built on GCLI:
https://developer.mozilla.org/en/docs/Tools/GCLI
https://github.com/joewalker/gcli/blob/master/docs/index.md -- even says that it could be used as part of a browser extension
There is currently a magic console in Firefox that we could perhaps hijack, which is built on GCLI: https://developer.mozilla.org/en/docs/Tools/GCLI https://github.com/joewalker/gcli/blob/master/docs/index.md -- even says that it could be used as part of a browser extension
# Avoiding JavaScript:
CoffeeScript; EMScripten, ELM, Node.js (interpretereter?)
(broccoli)
What is NPM? Browserify is dependency management
CoffeeScript; EMScripten, ELM, Node.js (interpretereter?) (broccoli) What is NPM? Browserify is dependency management
# Useful libraries
PEG - parses stuff (e.g. command input)
# cVim
Code not well documented, could glean useful stuff from just stripping out what Chrome API is used
## Useful links:
https://www.codementor.io/gmuresan/building-a-chrome-extension-reactjs-broccoli-sass-du1081zv0
# Useful links
https://developer.chrome.com/extensions/commands
https://github.com/lydell/webextension-keyboard
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Background_scripts
https://github.com/shinglyu/QuantumVim - Vimium style stuff in WebExtensions
https://github.com/mishoo/UglifyJS2 - Minify JS: check that compiling to Firefox addon doesn't already do this
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API
http://arcturo.github.io/library/coffeescript/ - Coffee Script textbook
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext - web-ext will automatically reload a changed extension
https://developer.chrome.com/extensions/commands https://github.com/lydell/webextension-keyboard https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Background_scripts https://github.com/shinglyu/QuantumVim - Vimium style stuff in WebExtensions https://github.com/mishoo/UglifyJS2 - Minify JS: check that compiling to Firefox addon doesn't already do this https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API http://arcturo.github.io/library/coffeescript/ - Coffee Script textbook https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext - web-ext will automatically reload a changed extension
# Names
Tridactyl (like Pentadactyl, but worse, last cuturally relevant in 2005 like Salad Fingers)
# Features we really really want
- Hiding misc UI (tabs, menu, urlbar, etc.)
- Interacting with other addons (simulating presses on buttons?)
- ]][[ to inc/dec url
- command line for opening tabs/completion/interacting with addons/changing settings
- "buffer" tab searching / tab groups?
- searching for tabs between windows?
* Hiding misc UI (tabs, menu, urlbar, etc.)
* Interacting with other addons (simulating presses on buttons?)
* ]][[ to inc/dec url
* command line for opening tabs/completion/interacting with addons/changing settings
* "buffer" tab searching / tab groups?
* searching for tabs between windows?
# Features we need less?
autocmds?
macros?
autocmds? macros?
# Vimium notes
Uses descriptors a lot - what even are they?
Loading into firefox doesn't give any errors / doesn't seem to expose any functions?
Uses descriptors a lot - what even are they? Loading into firefox doesn't give any errors / doesn't seem to expose any functions?
# Other stuff
Would be nice to have self-writing documentation, for autocmd use etc?
Could use .litcoffee for markdown comments in code.
Would be nice to have self-writing documentation, for autocmd use etc? Could use .litcoffee for markdown comments in code.
History seems to be window.history.go(), presumably in a content script?

View file

@ -31,6 +31,6 @@ Commands:
find {phrase} {direction=+/-1}
hints {open|tabopen|winopen|yank}
## search-likes
{page, google, amazon} {phrase}

View file

@ -3,11 +3,11 @@
We need to parse series of keypresses into `ex` commands, and then parse those commands into internal functions. We also need autocompletion of commands (maybe also in normal mode, qutebrowser style, to aid their discoverability), and the parser needs to change in real-time such that binds can be remapped.
We are considering:
- writing our own parser
- Nearley: https://github.com/Hardmath123/nearley
- Upsides: uses Earley, can use CoffeeScript
- PEG.js
- Downsides: uses PEG
* writing our own parser
* Nearley: https://github.com/Hardmath123/nearley
* Upsides: uses Earley, can use CoffeeScript
* PEG.js
* Downsides: uses PEG
Currently, we are erring on the side of writing our own parser, as neither of the other options allow for changing the parser sensibly, and do not seem to support partial matches. Generally, neither seem to be written with the expectation of interactive uses.

View file

@ -2,7 +2,7 @@
Some small browsers exist that use webkit/webengine for the heavy lifting. Two notable examples even have vim-like interfaces: qutebrowser and jumanji.
Extending them *might* be easy, depending on the quality of the existing code base. We also need to evaluate these projects for maintainability: they're obviously going to have much less development power.
Extending them _might_ be easy, depending on the quality of the existing code base. We also need to evaluate these projects for maintainability: they're obviously going to have much less development power.
If it's comparable to this project done in webextensions, then we might want to just build our own/fork/contribute.
@ -41,4 +41,3 @@ Maybe not:
* ref control is neat, but the UI is pants. Would be easy to build an ex-mode interface.
* pwgen is trivial
* https everywhere --> builtin?

View file

@ -1,8 +1,9 @@
# Stuff we'd like but maybe we might not be able to do
- Better link hinting
- One hint per identical link? (e.g. BBC News homepage works badly without this)
- Some links need simulated mouse click (e.g. JS)
* Better link hinting
- Better normal mode motions
- e.g, "next heading"
* One hint per identical link? (e.g. BBC News homepage works badly without this)
* Some links need simulated mouse click (e.g. JS)
* Better normal mode motions
* e.g, "next heading"

View file

@ -1,18 +1,20 @@
# Playing with Firefox background scripts
1. about:debugging - load temporary addon
2. click "debug"
3. click "console"
4. disable most things apart from logging
5. have fun
# Playing with content scripts
1. about:debugging
2. dunno the rest
# Experimental WebExtension API addons
1. complicated, but Colin knows a bit.
# Compiling CoffeeScript
coffee -c script.coffee

View file

@ -18,6 +18,6 @@ fi
if [ -n "$uglyFiles" ]; then
echo "Prettify your files first:"
echo '$(npm bin)/prettier --write' "${uglyFiles[@]}"
echo 'npm run pretty'
exit 1
fi

View file

View file

@ -1,5 +1,6 @@
Param (
[switch]$Uninstall = $false,
[switch]$NoPython= $false,
[string]$DebugDirBase = "",
[string]$InstallDirBase = ""
)
@ -8,26 +9,44 @@ Param (
# Global constants
#
$global:InstallDirName = ".tridactyl"
$global:MessengerBinName = "native_main.py"
$global:MessengerBinPyName = "native_main.py"
$global:MessengerBinExeName = "native_main.exe"
$global:MessengerBinWrapperFilename = "native_main.bat"
$global:MessengerManifestFilename = "tridactyl.json"
$global:PythonVersionStr = "Python 3"
$global:WinPython3Command = "py -3 -u"
$global:MessengerManifestReplaceStr = "REPLACE_ME_WITH_SED"
$global:MessengerFilesHttpUriBase = [string]::Format("{0}{1}",
"https://raw.githubusercontent.com",
"/cmcaine/tridactyl/master/native")
# $git_repo_owner should be "cmcaine" in final release
$git_repo_owner = "cmcaine"
# $git_repo_branch should be "master" in final release
$git_repo_branch = "cmcaine/master"
$git_repo_proto = "https"
$git_repo_host = "raw.githubusercontent.com"
$git_repo_name = "tridactyl"
$git_repo_dir = "native"
$global:MessengerFilesHttpUriBase = `
[string]::Format("{0}://{1}/{2}/{3}/{4}/{5}",
$git_repo_proto,
$git_repo_host,
$git_repo_owner,
$git_repo_name,
$git_repo_branch,
$git_repo_dir
)
$global:MessengerExeHttpUriBase = "https://tridactyl.cmcaine.co.uk/betas"
$global:MessengerManifestRegistryPath = `
"HKCU:\Software\Mozilla\NativeMessagingHosts\tridactyl"
$global:Uninstall = $Uninstall
$global:NoPython= $NoPython
$global:InstallDirBase = $InstallDirBase.Trim()
$global:DebugDirBase = $DebugDirBase.Trim()
function Get-PythonVersionStatus() {
try {
$pythonVersion = py -3 -u --version
$pythonVersion = Invoke-Expression `
"$global:WinPython3Command --version"
} catch {
$pythonVersion = ""
}
@ -150,12 +169,22 @@ function Set-InstallDir() {
}
}
function Get-MessengerBinName() {
$messengerBinName = $global:MessengerBinPyName
if ($global:NoPython -eq $true) { # system doesn't have python3
$messengerBinName = $global:MessengerBinExeName
}
Return $messengerBinName
}
function Get-MessengerBinPath() {
$messengerInstallDir = Get-MessengerInstallDir
$messengerBinName = Get-MessengerBinName
$native_messenger_binary_path = [string]::Format("{0}\{1}",
$messengerInstallDir,
$global:MessengerBinName)
$messengerBinName)
Return $native_messenger_binary_path.Trim()
}
@ -165,10 +194,18 @@ function Get-MessengerBinUri() {
-Date ((Get-Date).ToUniversalTime()) `
-UFormat %s)
$messengerBinName = Get-MessengerBinName
if ($global:NoPython -eq $true) { # system doesn't have python3
$messengerBinUri = [string]::Format("{0}/{1}",
$global:MessengerExeHttpUriBase,
$messengerBinName
)
} else {
$messengerBinUri = [string]::Format("{0}/{1}?{2}",
$global:MessengerFilesHttpUriBase,
$global:MessengerBinName,
$messengerBinName,
$downloadStartTime)
}
Return $messengerBinUri.Trim()
}
@ -178,15 +215,18 @@ function Set-MessengerBin() {
$messengerBinUri = Get-MessengerBinUri
if ($global:DebugDirBase.Length -gt 0) {
$messengerBinName = Get-MessengerBinName
$srcPath = [string]::Format("{0}\{1}",
$global:DebugDirBase,
$global:MessengerBinName)
$messengerBinName)
Write-Host "[+] Copying $srcPath ..."
Copy-Item `
-Path $srcPath `
-Destination $messengerBinPath
-Destination $messengerBinPath `
-Force `
} else {
Write-Host "[+] Downloading $messengerBinUri ..."
@ -233,10 +273,18 @@ function Get-MessengerBinWrapperPath() {
function Set-MessengerBinWrapper() {
$messengerBinPath = Get-MessengerBinPath
$messengerBinWrapperPath = Get-MessengerBinWrapperPath
if ($global:NoPython -eq $false) { # system has python3
$messengerWrapperContent = @"
@echo off
call py -3 -u $messengerBinPath
call $global:WinPython3Command $messengerBinPath
"@
} else { ## system does _not_ have python3
$messengerWrapperContent = @"
@echo off
call $messengerBinPath
"@
}
Write-Host "[+] Preparing $messengerBinWrapperPath ..."
@ -298,7 +346,8 @@ function Set-MessengerManifest() {
Copy-Item `
-Path $srcPath `
-Destination $messengerManifestPath
-Destination $messengerManifestPath `
-Force `
} else {
Write-Host "[+] Downloading $messengerManifestUri ..."
@ -437,23 +486,26 @@ function Set-MessengerManifestRegistry() {
}
function Set-MessengerInstall() {
# Check for Python 3
# Check if system has Python 3, unless user set # the
# `-NoPython` flag
if ($global:NoPython -eq $false) {
Write-Host "[+] Looking for Python 3 ..."
$pythonVersionStatus = Get-PythonVersionStatus
if (! $pythonVersionStatus) {
Write-Host " - Python 3 not found, quitting ..."
exit -1
Write-Host " - Python 3 not found, will use EXE ..."
$global:NoPython = $true
} else {
$pythonPath = Get-Command "py" `
| Select-Object -ExpandProperty "Source"
Write-Host " - Python 3 found at: $pythonPath"
}
}
# Prepare `.tridactyl` directory
$result = Set-InstallDir
# Prepare `native_main.py`
# Prepare `native_main.{py,exe}`
if ($result -eq $true) {
$result = Set-MessengerBin
}
@ -503,4 +555,3 @@ if ($global:Uninstall) {
}
Set-MessengerInstall

39
package-lock.json generated
View file

@ -2245,7 +2245,8 @@
"discontinuous-range": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz",
"integrity": "sha1-44Mx8IRLukm5qctxx3FYWqsbxlo="
"integrity": "sha1-44Mx8IRLukm5qctxx3FYWqsbxlo=",
"dev": true
},
"dispensary": {
"version": "0.10.10",
@ -5781,9 +5782,9 @@
"integrity": "sha1-GA8fnr74sOY45BZq1S24eb6y/8U="
},
"marked": {
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.3.6.tgz",
"integrity": "sha1-ssbGGPzOzk74bE/Gy4p8v1rtqNc=",
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.4.0.tgz",
"integrity": "sha512-tMsdNBgOsrUophCAFQl0XPe6Zqk/uy9gnue+jIIKhykO51hxyu6uNx7zBPy0+y/WKYVZZMspV9YeXLNdKk+iYw==",
"dev": true
},
"md5.js": {
@ -6096,13 +6097,15 @@
"optional": true
},
"nearley": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/nearley/-/nearley-2.11.0.tgz",
"integrity": "sha512-clqqhEuP0ZCJQ85Xv2I/4o2Gs/fvSR6fCg5ZHVE2c8evWyNk2G++ih4JOO3lMb/k/09x6ihQ2nzKUlB/APCWjg==",
"version": "2.13.0",
"resolved": "https://registry.npmjs.org/nearley/-/nearley-2.13.0.tgz",
"integrity": "sha512-ioYYogSaZhFlCpRizQgY3UT3G1qFXmHGY/5ozoFE3dMfiCRAeJfh+IPE3/eh9gCZvqLhPCWb4bLt7Bqzo+1mLQ==",
"dev": true,
"requires": {
"nomnom": "~1.6.2",
"railroad-diagrams": "^1.0.0",
"randexp": "^0.4.2"
"randexp": "0.4.6",
"semver": "^5.4.1"
}
},
"node-dir": {
@ -6193,6 +6196,7 @@
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.6.2.tgz",
"integrity": "sha1-hKZqJgF0QI/Ft3oY+IjszET7aXE=",
"dev": true,
"requires": {
"colors": "0.5.x",
"underscore": "~1.4.4"
@ -6201,7 +6205,8 @@
"colors": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz",
"integrity": "sha1-fQAj6usVTo7p/Oddy5I9DtFmd3Q="
"integrity": "sha1-fQAj6usVTo7p/Oddy5I9DtFmd3Q=",
"dev": true
}
}
},
@ -6941,12 +6946,14 @@
"railroad-diagrams": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz",
"integrity": "sha1-635iZ1SN3t+4mcG5Dlc3RVnN234="
"integrity": "sha1-635iZ1SN3t+4mcG5Dlc3RVnN234=",
"dev": true
},
"randexp": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz",
"integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==",
"dev": true,
"requires": {
"discontinuous-range": "1.0.0",
"ret": "~0.1.10"
@ -7300,7 +7307,8 @@
"ret": {
"version": "0.1.15",
"resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
"integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg=="
"integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
"dev": true
},
"right-align": {
"version": "0.1.3",
@ -8786,6 +8794,12 @@
"typescript": "2.4.1"
},
"dependencies": {
"marked": {
"version": "0.3.19",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz",
"integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==",
"dev": true
},
"progress": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz",
@ -8855,7 +8869,8 @@
"underscore": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz",
"integrity": "sha1-YaajIBBiKvoHljvzJSA88SI51gQ="
"integrity": "sha1-YaajIBBiKvoHljvzJSA88SI51gQ=",
"dev": true
},
"union-value": {
"version": "1.0.0",

View file

@ -9,7 +9,6 @@
"css": "^2.2.1",
"fuse.js": "^3.2.0",
"mark.js": "^8.11.1",
"nearley": "^2.11.0",
"semver-compare": "^1.0.0"
},
"devDependencies": {
@ -20,6 +19,8 @@
"cleanslate": "^0.10.1",
"copy-webpack-plugin": "^4.2.0",
"jest": "^21.2.1",
"marked": "^0.4.0",
"nearley": "^2.13.0",
"prettier": "^1.11.1",
"shared-git-hooks": "^1.2.1",
"source-map-loader": "^0.2.2",

247
readme.md
View file

@ -20,122 +20,105 @@ If you're enjoying Tridactyl, or not, please leave a review on the [AMO](https:/
## Highlighted features
Like Vim, Tridactyl is modal, with the default mode being "normal mode". In
"normal mode", many functions are available using keybindings. In "command
mode" (when the command line is shown), you can execute more complex commands,
known as "ex-commands". All Tridactyl functionality can be accessed by
ex-commands. You can bind any ex-command to a normal-mode shortcut. We also support a `.tridactylrc` file, of which there is an example in the root of this repository.
Like Vim, Tridactyl is modal, with the default mode being "normal mode". In "normal mode", many functions are available using keybindings. In "command mode" (when the command line is shown), you can execute more complex commands, known as "ex-commands". All Tridactyl functionality can be accessed by ex-commands. You can bind any ex-command to a normal-mode shortcut. We also support a `.tridactylrc` file, of which there is an example in the root of this repository.
### Default normal-mode bindings
This is a (non-exhaustive) list of the most common normal-mode bindings. Type
`:help` to open the online help for more details.
This is a (non-exhaustive) list of the most common normal-mode bindings. Type `:help` to open the online help for more details.
- `:` — activate the command line
- `Shift` + `Insert` — enter "ignore mode". Press `Shift` + `Insert` again to
return to "normal mode".
- `ZZ` — close all tabs and windows, but only "save" them if your
about:preferences are set to "show your tabs and windows from last time"
- `.` — repeat the last command
* `:` — activate the command line
* `Shift` + `Insert` — enter "ignore mode". Press `Shift` + `Insert` again to return to "normal mode".
* `ZZ` — close all tabs and windows, but only "save" them if your about:preferences are set to "show your tabs and windows from last time"
* `.` — repeat the last command
#### Navigating with the current page
- `j`/`k` — scroll down/up
- `h`/`l` — scroll left/right
- `^`/`$` — scroll to left/right margin
- `gg`/`G` — scroll to start/end of page
- `f`/`F` — enter "hint mode" to select a link to follow. `F` to open in a
background tab
- `gi` — scroll to and focus the last-used input on the page
- `r`/`R` — reload page or hard reload page
- `yy` — copy the current page URL to the clipboard
- `[[`/`]]` — navigate forward/backward though paginated pages, for example
comics, multi-part articles, search result pages, etc.
- `]c`/`[c` — increment/decrement the current URL by 1
- `gu` — go to the parent of the current URL
- `gU` — go to the root domain of the current URL
- `gr` — open Firefox reader mode (note: Tridactyl will not work in this mode)
- `zi`/`zo`/`zz` — zoom in/out/reset zoom
* `j`/`k` — scroll down/up
* `h`/`l` — scroll left/right
* `^`/`$` — scroll to left/right margin
* `gg`/`G` — scroll to start/end of page
* `f`/`F` — enter "hint mode" to select a link to follow. `F` to open in a background tab (note: hint characters should be typed in lowercase)
* `gi` — scroll to and focus the last-used input on the page
* `r`/`R` — reload page or hard reload page
* `yy` — copy the current page URL to the clipboard
* `[[`/`]]` — navigate forward/backward though paginated pages, for example comics, multi-part articles, search result pages, etc.
* `]c`/`[c` — increment/decrement the current URL by 1
* `gu` — go to the parent of the current URL
* `gU` — go to the root domain of the current URL
* `gr` — open Firefox reader mode (note: Tridactyl will not work in this mode)
* `zi`/`zo`/`zz` — zoom in/out/reset zoom
#### Find mode
Find mode is still incomplete and uses the built-in Firefox search. This will
be improved eventually.
Find mode is still incomplete and uses the built-in Firefox search. This will be improved eventually.
- `/` — open the find search box
- `C-g`/`C-G` — find the next/previous instance of the last find operation
(note: these are the standard Firefox shortcuts)
* `/` — open the find search box
* `C-g`/`C-G` — find the next/previous instance of the last find operation (note: these are the standard Firefox shortcuts)
#### Bookmarks and quickmarks
- `A` — bookmark the current page
- `a` — bookmark the current page, but allow the URL to be modified first
- `M<key>` — bind a quickmark to the given key
- `go<key>`/`gn<key>`/`gw<key>` — open a given quickmark in current tab/new tab/new window
* `A` — bookmark the current page
* `a` — bookmark the current page, but allow the URL to be modified first
* `M<key>` — bind a quickmark to the given key
* `go<key>`/`gn<key>`/`gw<key>` — open a given quickmark in current tab/new tab/new window
#### Navigating to new pages:
- `o`/`O` — open a URL (or default search) in this tab (`O` to pre-load current URL)
- `t`/`T` — open a URL (or default search) in a new tab (`T` to pre-load current URL)
- `w`/`W` — open a URL (or default search) in a new window (`W` to pre-load current URL)
- `p`/`P` — open the clipboard contents in the current/new tab
- `s`/`S` — force a search using the default Tridactyl search engine, opening
in the current/new tab. This is useful when searching for something that
would otherwise be treated as a URL by `o` or `t`
- `H`/`L` — go back/forward in the tab history
- `gh`/`gH` — go to the home page (in a new tab)
* `o`/`O` — open a URL (or default search) in this tab (`O` to pre-load current URL)
* `t`/`T` — open a URL (or default search) in a new tab (`T` to pre-load current URL)
* `w`/`W` — open a URL (or default search) in a new window (`W` to pre-load current URL)
* `p`/`P` — open the clipboard contents in the current/new tab
* `s`/`S` — force a search using the default Tridactyl search engine, opening in the current/new tab. This is useful when searching for something that would otherwise be treated as a URL by `o` or `t`
* `H`/`L` — go back/forward in the tab history
* `gh`/`gH` — go to the pages you have set with `set home [url1] [url2] ...`
#### Handling tabs
- `d` — close the current tab
- `u` — undo the last tab/window closure
- `gt`/`gT` — go to the next/previous tab
- `g^`/`g$` — go to the first/last tab
- `b` — bring up a list of open tabs in the current window; you can type the
tab ID or part of the title or URL to choose a tab
* `d` — close the current tab
* `u` — undo the last tab/window closure
* `gt`/`gT` — go to the next/previous tab
* `g^`/`g$` — go to the first/last tab
* `b` — bring up a list of open tabs in the current window; you can type the tab ID or part of the title or URL to choose a tab
#### Extended hint mode
Extended hint modes allow you to perform actions on page items:
- `;i`/`;I` — open an image (in current/new tab)
- `;s`/`;a` — save/save-as the linked resource
- `;S`/`;A` — save/save-as the selected image
- `;p` — copy an element's text to the clipboard
- `;P` — copy an element's title/alt text to the clipboard
- `;y` — copy an element's link URL to the clipboard
- `;#` — copy an element's anchor URL to the clipboard
- `;r` — read the element's text with text-to-speech
- `;k` — delete an element from the page
- `;;` — focus an element
* `;i`/`;I` — open an image (in current/new tab)
* `;s`/`;a` — save/save-as the linked resource
* `;S`/`;A` — save/save-as the selected image
* `;p` — copy an element's text to the clipboard
* `;P` — copy an element's title/alt text to the clipboard
* `;y` — copy an element's link URL to the clipboard
* `;#` — copy an element's anchor URL to the clipboard
* `;r` — read the element's text with text-to-speech
* `;k` — delete an element from the page
* `;;` — focus an element
Additionally, you can bind to a custom CSS selector with `:hint -c [selector]`
which is useful for site-specific versions of the standard `f` hint mode.
Additionally, you can hint elements matching a custom CSS selector with `:hint -c [selector]` which is useful for site-specific versions of the standard `f` hint mode.
### Binding custom commands
You can bind your own shortcuts in normal mode with the `:bind` command.
For example `:bind J tabprev` to bind `J` to switch to the previous tab.
See `:help bind` for details about this command.
You can bind your own shortcuts in normal mode with the `:bind` command. For example `:bind J tabprev` to bind `J` to switch to the previous tab. See `:help bind` for details about this command.
## WebExtension-related issues
- Navigation to any about:\* pages using `:open` requires the native messenger.
- Firefox will not load Tridactyl on about:\*, some file:\* URIs, view-source:\*, or data:\*. On these pages Ctrl-L (or F6), Ctrl-Tab and Ctrl-W are your escape hatches.
- addons.mozilla.org is now supported so long as you run `fixamo` first.
- Tridactyl now supports changing the Firefox GUI if you have the native messenger installed via `guiset`. There's quite a few options available, but `guiset gui none` is probably what you want, perhaps followed up with `guiset tabs always`.
* Navigation to any about:\* pages using `:open` requires the native messenger.
* Firefox will not load Tridactyl on about:\*, some file:\* URIs, view-source:\*, or data:\*. On these pages Ctrl-L (or F6), Ctrl-Tab and Ctrl-W are your escape hatches.
* addons.mozilla.org is now supported so long as you run `fixamo` first.
* Tridactyl now supports changing the Firefox GUI if you have the native messenger installed via `guiset`. There's quite a few options available, but `guiset gui none` is probably what you want, perhaps followed up with `guiset tabs always`.
## Frequently asked questions
- Why doesn't Tridactyl respect my search engine settings?
* Why doesn't Tridactyl respect my search engine settings?
It's a webextension limitation. Firefox doesn't allow reading user preferences.
- How can I change the search engine?
* How can I change the search engine?
`set searchengine duckduckgo`
- How can I add a search engine?
* How can I add a search engine?
`set searchurls.esa http://www.esa.int/esasearch?q=`
@ -145,25 +128,25 @@ See `:help bind` for details about this command.
after which `open phrasebook [fr|de|la|es|hi|it...]` will work as expected.
- Can I import/export settings, and does Tridactyl use an external configuration file just like Vimperator?
* Can I import/export settings, and does Tridactyl use an external configuration file just like Vimperator?
Yes, if you have `native` working, `$XDG_CONFIG_DIR/tridactyl/tridactylrc` or `~/.tridactylrc` will be read at startup via an `autocmd` and `source`. There is an [example file available on our repository](https://github.com/cmcaine/tridactyl/blob/master/.tridactylrc).
If you can't use the native messenger for some reason, there is a workaround: if you do `set storageloc local`, a JSON file will appear at `<your firefox profile>\browser-extension-data\tridactyl.vim@cmcaine.co.uk\storage.js`. You can find your profile folder by going to `about:support`. You can edit this file to your heart's content.
- I hate the light, can I get a dark theme/dark mode?
* I hate the light, can I get a dark theme/dark mode?
Yes: `set theme dark` or `colors dark`. Thanks to @fugerf.
- How can I pretend that I'm not a 1337 h4x0r?
* How can I pretend that I'm not a 1337 h4x0r?
We cater for you, too! `set theme shydactyl`. Thanks to @atrnh.
- How can I pretend that I'm a 1337 h4x0r?
* How can I pretend that I'm a 1337 h4x0r?
We cater for you, too! `set theme greenmat`. Thanks to @caputchinefrobles.
- How can I bind keys using the control/alt key modifiers (eg: `ctrl+^`)?
* How can I bind keys using the control/alt key modifiers (eg: `ctrl+^`)?
`:bind <C-f> scrollpage 1`. Special keys can be bound too: `:bind <F3> set theme dark` and with modifiers: `:bind <S-F3> set theme default` and with multiple modifiers: `:bind <SA-F3> composite set hintchars 1234567890 | set hintfiltermode vimperator-reflow`
@ -171,55 +154,54 @@ See `:help bind` for details about this command.
If you want to bind <C-^> you'll find that you'll probably need to press Control+Shift+6 to trigger it. The default bind is <C-6> which does not require you to press shift.
- How can I tab complete from bookmarks?
* How can I tab complete from bookmarks?
`bmarks`. Bookmarks are not currently supported on `*open`: see [issue #214](https://github.com/cmcaine/tridactyl/issues/214).
- When I type 'f', can I type link names (like Vimperator) in order to narrow down the number of highlighted links?
* When I type 'f', can I type link names (like Vimperator) in order to narrow down the number of highlighted links?
You can, thanks to @saulrh. First `set hintfiltermode vimperator` and then `set hintchars 1234567890`.
- How to remap keybindings in both normal mode and ex mode?
* How to remap keybindings in both normal mode and ex mode?
You cannot. We only support normal mode bindings for now, with `bind [key] [excmd]`
- Where can I find a changelog for the different versions (to see what is new in the latest version)?
* Where can I find a changelog for the different versions (to see what is new in the latest version)?
[Here.](https://github.com/cmcaine/tridactyl/blob/master/CHANGELOG.md)
- Why can't I use my bookmark keywords?
* Why can't I use my bookmark keywords?
Mozilla doesn't give us access to them. See [issue #73](https://github.com/cmcaine/tridactyl/issues/73).
- Why doesn't Tridactyl work on websites with frames?
* Why doesn't Tridactyl work on websites with frames?
It should work on some frames now. See [#122](https://github.com/cmcaine/tridactyl/issues/122).
- Can I change proxy via commands?
* Can I change proxy via commands?
Not yet, but this feature will eventually be implemented.
- How do I disable Tridactyl on certain sites?
* How do I disable Tridactyl on certain sites?
You can't yet, see [#158](https://github.com/cmcaine/tridactyl/issues/158).
- How can I list the current bindings?
* How can I list the current bindings?
`viewconfig nmaps` works OK, but Tridactyl commands won't work on the shown page for "security reasons". We'll eventually provide a better way. See [#98](https://github.com/cmcaine/tridactyl/issues/98).
- Why doesn't Tridactyl work on some pages?
* Why doesn't Tridactyl work on some pages?
   One possible reason is that the site has a strict content security policy. We can rewrite these to make Tridactyl work, but we do not want to worsen the security of sensitive pages, so it is taking us a little while. See [#112](https://github.com/cmcaine/tridactyl/issues/112).
One possible reason is that the site has a strict content security policy. We can rewrite these to make Tridactyl work, but we do not want to worsen the security of sensitive pages, so it is taking us a little while. See [#112](https://github.com/cmcaine/tridactyl/issues/112).
- How can I know which mode I'm in/have a status line?
* How can I know which mode I'm in/have a status line?
Press `j` and see if you scroll down :) There's no status line yet: see [#210](https://github.com/cmcaine/tridactyl/issues/210), but we do have a "mode indicator" in the bottom right. It even goes purple when you're in a private window :).
- Does anyone actually use Tridactyl?
* Does anyone actually use Tridactyl?
In addition to the developers, some other people do. Mozilla keeps tabs on them [here](https://addons.mozilla.org/en-US/firefox/addon/tridactyl-vim/statistics/?last=30).
## Contributing
### Building and installing
@ -248,18 +230,80 @@ $(npm bin)/web-ext build -s build
If you want to build a signed copy (e.g. for the non-developer release), you can do that with `web-ext sign`. You'll need some keys for AMO and to edit the application id in `src/manifest.json`. There's a helper script in `scripts/sign` that's used by our build bot and for manual releases.
#### Building on Windows
### Building on Windows
- Install [Git for Windows][win-git]
* Install [Git for Windows][win-git]
- Install [NodeJS for Windows][win-nodejs]
- Current 8.11.1 LTS seems to work fine
* Install [NodeJS for Windows][win-nodejs]
- Launch the installation steps described above from MinTTY shell
- Also known as "Git Bash"
* Current 8.11.1 LTS seems to work fine
* Launch the installation steps described above from MinTTY shell
* Also known as "Git Bash"
[win-git]: https://git-scm.com/download/win
[win-nodejs]: https://nodejs.org/dist/v8.11.1/node-v8.11.1-x64.msi
[pyinstaller]: https://www.pyinstaller.org
[gpg4win]: https://www.gpg4win.org
<!--- ## Disable GPG signing for now, until decided otherwise later
### Cryptographically Verifying the Compiled Native Binary on Windows
- `native_main.py` is compiled to `native_main.exe` for Windows using [PyInstaller][pyinstaller]. The goal is to relieve Tridactyl users on Windows from having to install the whole Python 3 distribution.
- Due to `native_main.exe` being a binary-blob and difficult to easily review like the plain-text `native_main.py` counterpart, it is **strongly** recommended the users verify the SHA-256 hash and GPG signatures using the following commands on Powershell.
**Verifying SHA-256 Hash**
```
## Change directory to Tridactyl's native-messanger directory
PS C:\> cd "$env:HOME\.tridactyl"
## Run `dir` and check `native_main.exe` is found
PS C:\Users\{USERNAME}\.tridactyl> dir
## Download `native_main.exe.sha256` containing the SHA-256 sum
PS C:\Users\{USERNAME}\.tridactyl> iwr https://raw.githubusercontent.com/gsbabil/tridactyl/master/native/native_main.exe.sha256 -OutFile native_main.exe.sha256
## Print the SHA-256 sum from `native_main.exe.sha256`
PS C:\Users\{USERNAME}\.tridactyl> (Get-FileHash native_main.exe -Algorithm SHA256).Hash.ToLower()
## Compute SHA-256 sum from `native_main.exe`
PS C:\Users\{USERNAME}\.tridactyl> Get-Content -Path native_main.exe.sha256 | %{$_ .Split(' ')[0]}
## Compare results of the of the last two commands ...
```
**Verifying OpenPGP Signature***
- First, download [`GPG4Win`][gpg4win] from this website and
install in on your system
- Once `gpg2` is on your path, go to Powershell and run the
following commands to verify OpenPGP signature:
```
## Change directory to Tridactyl's native-messanger directory
PS C:\> cd "$env:HOME\.tridactyl"
## Run `dir` and check `native_main.exe` is found
PS C:\Users\{USERNAME}\.tridactyl> dir
## Download `native_main.exe.sig` containing the OpenPGP signature
PS C:\Users\{USERNAME}\.tridactyl> iwr https://raw.githubusercontent.com/gsbabil/tridactyl/master/native/native_main.exe.sig -OutFile native_main.exe.sig
## Download `gsbabil-pub.asc` to verify the signature
PS C:\Users\{USERNAME}\.tridactyl> iwr https://raw.githubusercontent.com/gsbabil/tridactyl/master/native/gsbabil-pub.asc -OutFile gsbabil-pub.asc
## Import `gsbabil-pub.asc` into your GPG key-ring
PS C:\Users\{USERNAME}\.tridactyl> gpg2 --armor --import gsbabil-pub.asc
## Verify signature using `gpg2`
PS C:\Users\{USERNAME}\.tridactyl> gpg2 --verify .\native_main.exe.sig .\native_main.exe
```
--->
### Development loop
@ -268,6 +312,7 @@ npm run build & npm run run
```
<!-- This will compile and deploy your files each time you save them. -->
You'll need to run `npm run build` every time you edit the files, and press "r" in the `npm run run` window to make sure that the files are properly reloaded.
### Committing
@ -280,7 +325,7 @@ Ask in `#tridactyl` on [matrix.org][matrix-link], freenode, or [gitter][gitter-l
Default keybindings are currently best discovered by reading the [default config](./src/config.ts).
Development notes are in the doc directory, but they're mostly out of date now. Code is quite short and not *too* badly commented, though.
Development notes are in the doc directory, but they're mostly out of date now. Code is quite short and not _too_ badly commented, though.
## Principles and objectives

View file

@ -3,4 +3,4 @@
# Put the AMO flavour text in your clipboard for easy pasting.
# AMO doesn't support all HTML in markdown so we strip it out.
marked doc/amo.md | sed -r "s/<.?p>//g" | sed -r "s/<.?h.*>//g" | xclip -selection "clipboard"
$(npm bin)/marked doc/amo.md | sed -r "s/<.?p>//g" | sed -r "s/<.?h.*>//g" | xclip -selection "clipboard"

8
scripts/authors.sh Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
cd src/static
authors="../../build/static/authors.html"
sed "/REPLACETHIS/,$ d" authors.html > "$authors"
git shortlog -sn | cut -c8- | sed 's/^/<p>/' | sed 's/$/<\/p>/' >> "$authors"
sed "1,/REPLACETHIS/ d" authors.html >> "$authors"

View file

@ -6,7 +6,8 @@ CLEANSLATE="node_modules/cleanslate/docs/files/cleanslate.css"
isWindowsMinGW() {
local is_mingw="False"
if [ "$(uname | cut -c 1-5)" = "MINGW" ]; then
if [ "$(uname | cut -c 1-5)" = "MINGW" ] \
|| [ "$(uname | cut -c 1-4)" = "MSYS" ]; then
is_mingw="True"
fi
@ -37,7 +38,7 @@ scripts/newtab.md.sh
scripts/make_tutorial.sh
scripts/make_docs.sh &
nearleyc src/grammars/bracketexpr.ne \
$(npm bin)/nearleyc src/grammars/bracketexpr.ne \
> src/grammars/.bracketexpr.generated.ts
if [ "$(isWindowsMinGW)" = "True" ]; then
@ -56,6 +57,7 @@ fi
wait
scripts/bodgecss.sh
scripts/authors.sh
if [ -e "$CLEANSLATE" ] ; then
cp -v "$CLEANSLATE" build/static/css/cleanslate.css

View file

@ -1,7 +1,7 @@
#!/bin/bash
cachedJS() {
git diff --cached --name-only --diff-filter=ACM "*.js" "*.jsx" "*.ts" "*.tsx" | tr '\n' ' '
git diff --cached --name-only --diff-filter=ACM "*.js" "*.jsx" "*.ts" "*.tsx" "*.md" "*.css" | tr '\n' ' '
}
staged() {

View file

@ -1,4 +1,4 @@
#!/bin/sh
dest=generated/static/docs
typedoc --theme src/static/typedoc/ --out $dest src --ignoreCompilerErrors
$(npm bin)/typedoc --theme src/static/typedoc/ --out $dest src --ignoreCompilerErrors
cp -r $dest build/static/

View file

@ -11,6 +11,6 @@ for page in $pages
do
fileroot=$(echo $page | cut -d'.' -f-1)
sed "/REPLACETHIS/,$ d" tutor.template.html > "$dest$fileroot.html"
marked $page >> "$dest$fileroot.html"
$(npm bin)/marked $page >> "$dest$fileroot.html"
sed "1,/REPLACETHIS/ d" tutor.template.html >> "$dest$fileroot.html"
done

View file

@ -8,7 +8,7 @@ newtab="../../generated/static/newtab.html"
newtabtemp="../../generated/static/newtab.temp.html"
sed "/REPLACETHIS/,$ d" newtab.template.html > "$newtabtemp"
marked newtab.md >> "$newtabtemp"
$(npm bin)/marked newtab.md >> "$newtabtemp"
sed "1,/REPLACETHIS/ d" newtab.template.html >> "$newtabtemp"
# Why think when you can pattern match?
@ -19,7 +19,7 @@ echo """
<label for="spoilerbutton" onclick="">Changelog</label>
<div class="spoiler">
""" >> "$newtab"
marked ../../CHANGELOG.md >> "$newtab"
$(npm bin)/marked ../../CHANGELOG.md >> "$newtab"
echo """
</div>
""" >> "$newtab"

View file

@ -19,7 +19,7 @@ publish_stable() {
npm run clean
npm run build
sign_and_submit
tar --exclude-from=.gitignore --exclude=.git/* -czf ../public_html/betas/tridactyl_source.tar.gz .
tar --exclude-from=.gitignore -czf ../public_html/betas/tridactyl_source.tar.gz .
}
case $1 in

167
scripts/wine-pyinstaller.sh Executable file
View file

@ -0,0 +1,167 @@
#!/bin/bash -e
# This script must be run from the root Tridactyl directory
TRIDIR="$(pwd)"
BUILDROOT="${TRIDIR}/.wine-pyinstaller"
OUTDIR="${BUILDROOT}/dist"
DLDIR="${BUILDROOT}/downloads"
PYVER="3.5.4"
PYDIR="${BUILDROOT}/python-${PYVER}"
WINPY_HASH="b5d90c5252a624117ccec8678862d6144710219737f06cd01deb1df963f639fd"
WINPY_EXE="${DLDIR}/winpython-${PYVER}.exe"
WINEDIR="${BUILDROOT}/wine"
WINEARCH="win32"
export WINEDEBUG="fixme-all"
# stop wine whining
export DISPLAY=
PREREQUISITES="tput printf 7z wine"
MIN_WINE_VER="3"
MIN_7ZIP_VER="16"
checkRequiredVersions() {
if [ -z "$(7z \
| awk '/Version/{print $3}' \
| grep "${MIN_7ZIP_VER}")" ]; then
colorEcho \
"[-] p7zip minimum version ${MIN_7ZIP_VER} required\n" \
"alert"
exit -1
fi
if [ -z "$(wine --version 2> /dev/null \
| grep "wine-${MIN_WINE_VER}")" ]; then
colorEcho \
"[-] wine minimum version ${MIN_WINE_VER} required\n" \
"alert"
exit -1
fi
}
stripWhitespace() {
local input="$@"
printf "${input}\n" | tr -d "[:space:]"
}
colorEcho() {
local COLOR_RESET=$(tput sgr0 2>/dev/null)
local COLOR_BOLD=$(tput bold 2>/dev/null)
local COLOR_BAD=$(tput setaf 1 2>/dev/null)
local COLOR_GOOD=$(tput setaf 2 2>/dev/null)
local str="$1"
local color="${COLOR_GOOD}${COLOR_BOLD}"
if [ ! -z "$2" ] \
&& [ "$(stripWhitespace "$2")" = "alert" ]; then
color="${COLOR_BAD}${COLOR_BOLD}"
fi
printf "${color}${str}${COLOR_RESET}"
}
checkPrerequisite() {
local bin_name="$1"
local bin_loc=$(which "${bin_name}" 2>/dev/null)
if [ -z "${bin_loc}" ] \
|| [ ! -f "${bin_loc}" ]; then
printf " - '$1' not found, quitting ...\n"
exit -1
else
printf " - '${bin_name}' found at ${bin_loc}\n"
fi
}
mainFunction() {
export "WINEARCH=${WINEARCH}"
export "WINEPREFIX=${WINEDIR}"
## Check prerequisites
colorEcho "[+] Checking prerequisites ...\n"
for bin in ${PREREQUISITES}; do
checkPrerequisite "${bin}"
done
checkRequiredVersions
## Create required directories
mkdir -pv "${BUILDROOT}"
mkdir -pv "${DLDIR}"
mkdir -pv "${OUTDIR}"
mkdir -pv "$TRIDIR"/web-ext-artifacts/
## Download Python and Pip
colorEcho "[+] Downloading necessary files ...\n"
if [ ! -f "${WINPY_EXE}" ]; then
wget \
"https://github.com/winpython/winpython/releases/download/1.10.20180404/WinPython32-${PYVER}.2Zero.exe" \
-O "${WINPY_EXE}"
fi
if [ ! "$(sha256sum "${WINPY_EXE}" \
| cut -d" " -f1)" = ${WINPY_HASH} ]; then
colorEcho "[-] ${WINPY_EXE} has incorrect hash, quitting ...\n"
exit 1
fi
## Extract Python-3.5.4 from WinPython if required
rm -rf "${WINEDIR}"
local winepython="wine $PYDIR/python.exe"
if [ ! -f "$PYDIR/python.exe" ]; then
colorEcho "[+] Extract Python-${PYVER}\n"
7z x "${DLDIR}/winpython-${PYVER}.exe" "python-$PYVER" -o"$BUILDROOT"
$winepython -m pip install --upgrade pip
colorEcho "[+] Installing PyInstaller ...\n"
$winepython -m pip install pyinstaller
fi
## Compile with PyInstaller
colorEcho "[+] Compiling with PyInstaller under Wine ...\n"
rm -rf "${OUTDIR}"
PYTHONHASHSEED=1 wine "$PYDIR"/Scripts/pyinstaller.exe \
--clean \
--console \
--onefile \
--noupx \
--noconfir \
--log-level=ERROR \
--workpath "${OUTDIR}" \
--distpath "${OUTDIR}" \
"$TRIDIR/native/native_main.py"
## Test the compiled EXE
colorEcho "[+] Checking compiled binary ...\n"
OUTFILE="${OUTDIR}/native_main.exe"
cp "$OUTFILE" "$TRIDIR"/web-ext-artifacts/
if [ -f "${OUTFILE}" ]; then
python3 \
"$TRIDIR/native/gen_native_message.py" cmd..version \
| wine "$TRIDIR"/web-ext-artifacts/native_main.exe
printf "\n"
colorEcho "[+] PyInstaller with Wine was successful!\n"
else
colorEcho \
"[-] PyInstaller compilation failed, quitting ...\n" \
"alert"
exit -1
fi
}
mainFunction "$@"

View file

@ -73,8 +73,8 @@ const DEFAULTS = o({
"<c-6>": "buffer #",
H: "back",
L: "forward",
"<c-o>": "back",
"<c-i>": "forward",
"<c-o>": "jumpprev",
"<c-i>": "jumpnext",
d: "tabclose",
D: "composite tabprev; sleep 100; tabclose #",
gx0: "tabclosealltoleft",
@ -126,7 +126,8 @@ const DEFAULTS = o({
"<S-Insert>": "mode ignore",
"<CA-Esc>": "mode ignore",
"<CA-`>": "mode ignore",
I: "fillcmdline Ignore mode is now toggled by pressing <S-Insert>",
I:
"fillcmdline Ignore mode is now toggled by pressing <S-Insert> or <C-A-`>",
a: "current_url bmark",
A: "bmark",
zi: "zoom 0.1 true",
@ -175,6 +176,7 @@ const DEFAULTS = o({
sanitize: "sanitise",
tutorial: "tutor",
h: "help",
authors: "credits",
openwith: "hint -W",
"!": "exclaim",
"!s": "exclaim_quiet",
@ -231,6 +233,11 @@ const DEFAULTS = o({
// Maybe have a nice user-vicible message when the setting is changed?
allowautofocus: "true",
// These two options will fall back to user's preferences and then to a
// default value set in scrolling.ts if left undefined.
smoothscroll: undefined, // "false" | "true"
scrollduration: undefined, // number
tabopenpos: "next",
relatedopenpos: "related",
ttsvoice: "default", // chosen from the listvoices list, or "default"
@ -250,6 +257,8 @@ const DEFAULTS = o({
theme: "default", // currently available: "default", "dark"
modeindicator: "true",
jumpdelay: 3000, // Milliseconds before registering a scroll in the jumplist
// Default logging levels - 2 === WARNING
logging: o({
messaging: 2,
@ -272,9 +281,9 @@ const DEFAULTS = o({
nativeinstallcmd:
"curl -fsSl https://raw.githubusercontent.com/cmcaine/tridactyl/master/native/install.sh | bash",
win_powershell_nativeinstallcmd:
"Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/gsbabil/tridactyl/master/native/win_install.ps1'))",
"Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/cmcaine/tridactyl/master/native/win_install.ps1'))",
win_cmdexe_nativeinstallcmd:
'@"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" -NoProfile -InputFormat None -Command "iex ((New-Object System.Net.WebClient).DownloadString(\'https://raw.githubusercontent.com/gsbabil/tridactyl/master/native/win_install.ps1\'))"',
'@"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" -NoProfile -InputFormat None -Command "iex ((New-Object System.Net.WebClient).DownloadString(\'https://raw.githubusercontent.com/cmcaine/tridactyl/master/native/win_install.ps1\'))"',
profiledir: "auto",
// Container settings

View file

@ -4,7 +4,7 @@
Use `:help <excmd>` or scroll down to show [[help]] for a particular excmd.
The default keybinds can be found [here](/static/docs/modules/_config_.html#defaults) or all active binds can be seen with `:viewconfig nmaps`.
The default keybinds can be found [here](/static/docs/modules/_src_config_.html#defaults) or all active binds can be seen with `:viewconfig nmaps`.
You can also view them with [[bind]]. Try `bind j`.
For more information, and FAQs, check out our [readme][4] on github.
@ -33,7 +33,7 @@
You do not need to worry about types. Return values which are promises will turn into whatever they promise to when used in [[composite]].
At the bottom of each function's help page, you can click on a link that will take you straight to that function's definition in our code. This is especially recommended for browsing the [config](/static/docs/modules/_config_.html#defaults) which is nigh-on unreadable on these pages.
At the bottom of each function's help page, you can click on a link that will take you straight to that function's definition in our code. This is especially recommended for browsing the [config](/static/docs/modules/_src_config_.html#defaults) which is nigh-on unreadable on these pages.
## Highlighted features:
@ -41,8 +41,9 @@
- Press `b` to bring up a list of open tabs in the current window; you can
type the tab ID or part of the title or URL to choose a tab
- Press `Shift` + `Insert` to enter "ignore mode". Press `Shift` + `Insert`
again to return to "normal mode".
- Press `f` to start "hint mode", `F` to open in background
again to return to "normal mode". `<C-A-backtick>` also works both ways.
- Press `f` to start "hint mode", `F` to open in background (note: hint
characters should be typed in lowercase)
- Press `o` to `:open` a different page
- Press `s` if you want to search for something that looks like a domain
name or URL
@ -70,7 +71,7 @@
[1]: https://github.com/cmcaine/tridactyl/issues
[2]: https://github.com/cmcaine/tridactyl/blob/master/src/static/userChrome-minimal.css
[3]: https://www.mozilla.org/en-US/firefox/organizations/
[3]: https://www.mozilla.org/en-GB/firefox/organizations/all/#legacy
[4]: https://github.com/cmcaine/tridactyl#readme
[gitter-badge]: /static/badges/gitter-badge.svg
@ -104,6 +105,7 @@ import * as SELF from "./.excmds_content.generated"
Messaging.addListener("excmd_content", Messaging.attributeCaller(SELF))
import * as DOM from "./dom"
import { executeWithoutCommandLine } from "./commandline_content"
import * as scrolling from "./scrolling"
// }
//#background_helper
@ -117,6 +119,7 @@ import * as keydown from "./keydown_background"
import { activeTab, firefoxVersionAtLeast, openInNewTab } from "./lib/webext"
import * as CommandLineBackground from "./commandline_background"
import * as rc from "./config_rc"
import * as excmd_parser from "./parsers/exmode"
//#background_helper
import * as Native from "./native_background"
@ -190,7 +193,7 @@ import * as css_util from "./css_util"
*
* Might mangle your userChrome. Requires native messenger, and you must restart Firefox each time to see any changes (this can be done using [[restart]]). <!-- (unless you enable addon debugging and refresh using the browser toolbox) -->
*
* View available rules and options [here](/static/docs/modules/_css_util_.html#potentialrules) and [here](/static/docs/modules/_css_util_.html#metarules).
* View available rules and options [here](/static/docs/modules/_src_css_util_.html#potentialrules) and [here](/static/docs/modules/_src_css_util_.html#metarules).
*
* Example usage: `guiset gui none`, `guiset gui full`, `guiset tabs autohide`.
*
@ -283,16 +286,19 @@ export async function fixamo() {
* **Be *seriously* careful with this: you can use it to open any URL you can open in the Firefox address bar.**
*
* You've been warned.
*
* Unsupported on OSX unless you set `browser` to something that will open Firefox from a terminal pass it commmand line options.
*/
//#background
export async function nativeopen(url: string, ...firefoxArgs: string[]) {
if (firefoxArgs.length === 0) firefoxArgs = ["--new-tab"]
if (await Native.nativegate()) {
if ((await browser.runtime.getPlatformInfo()).os === "mac") {
let osascriptArgs = ["-e 'on run argv'", "-e 'tell application \"Firefox\" to open location item 1 of argv'", "-e 'end run'"]
Native.run("osascript " + osascriptArgs.join(" ") + " " + url)
} else {
if (firefoxArgs.length === 0) firefoxArgs = ["--new-tab"]
Native.run(config.get("browser") + " " + firefoxArgs.join(" ") + " " + url)
}
}
}
/**
* Run command in /bin/sh (unless you're on Windows), and print the output in the command line. Non-zero exit codes and stderr are ignored, currently.
@ -522,6 +528,110 @@ export function loggingsetlevel(logModule: string, level: string) {
// {{{ PAGE CONTEXT
//#content_helper
export let JUMPED: boolean
//#content_helper
export function getJumpPageId() {
return document.location.href
}
//#content_helper
export async function saveJumps(jumps) {
browserBg.sessions.setTabValue(await activeTabId(), "jumps", jumps)
}
//#content_helper
export async function curJumps() {
let tabid = await activeTabId()
let jumps = await browserBg.sessions.getTabValue(tabid, "jumps")
if (!jumps) jumps = {}
let ensure = (obj, key, def) => {
if (obj[key] === null || obj[key] === undefined) obj[key] = def
}
let page = getJumpPageId()
ensure(jumps, page, {})
ensure(jumps[page], "list", [{ x: 0, y: 0 }])
ensure(jumps[page], "cur", 0)
saveJumps(jumps)
return jumps
}
//#content
export function jumpnext(n = 1) {
jumpprev(-n)
}
/** Similar to Pentadactyl or vim's jump list.
Should be bound to <C-o> when modifiers are implemented
*/
//#content
export function jumpprev(n = 1) {
curJumps().then(alljumps => {
let jumps = alljumps[getJumpPageId()]
let current = jumps.cur - n
if (current < 0) {
jumps.cur = 0
saveJumps(alljumps)
return back(-current)
} else if (current >= jumps.list.length) {
jumps.cur = jumps.list.length - 1
saveJumps(alljumps)
return forward(current - jumps.list.length + 1)
}
jumps.cur = current
let p = jumps.list[jumps.cur]
saveJumps(alljumps)
JUMPED = true
window.scrollTo(p.x, p.y)
})
}
/** Called on 'scroll' events.
If you want to have a function that moves within the page but doesn't add a
location to the jumplist, make sure to set JUMPED to true before moving
around.
The setTimeout call is required because sometimes a user wants to move
somewhere by pressing 'j' multiple times and we don't want to add the
in-between locations to the jump list
*/
//#content_helper
export function addJump(scrollEvent: UIEvent) {
if (JUMPED) {
JUMPED = false
return
}
let pageX = scrollEvent.pageX
let pageY = scrollEvent.pageY
// Get config for current page
curJumps().then(alljumps => {
let jumps = alljumps[getJumpPageId()]
// Prevent pending jump from being registered
clearTimeout(jumps.timeoutid)
// Schedule the registering of the current jump
jumps.timeoutid = setTimeout(() => {
let list = jumps.list
// if the page hasn't moved, stop
if (list[jumps.cur].x == pageX && list[jumps.cur].y == pageY) return
// Store the new jump
// Could removing all jumps from list[cur] to list[list.length] be
// a better/more intuitive behavior?
list.push({ x: pageX, y: pageY })
jumps.cur = jumps.list.length - 1
saveJumps(alljumps)
}, config.get("jumpdelay"))
})
}
//#content_helper
document.addEventListener("scroll", addJump)
// Try to restore the previous jump position every time a page is loaded
//#content_helper
curJumps().then(() => {
jumpprev(0)
})
/** Blur (unfocus) the active element */
//#content
export function unfocus() {
@ -530,10 +640,8 @@ export function unfocus() {
}
//#content
export function scrollpx(a: number, b: number) {
let top = document.body.getClientRects()[0].top
window.scrollBy(a, b)
if (top == document.body.getClientRects()[0].top) recursiveScroll(a, b, [document.body])
export async function scrollpx(a: number, b: number) {
if (!await scrolling.scroll(a, b, document.documentElement)) scrolling.recursiveScroll(a, b, [document.documentElement])
}
/** If two numbers are given, treat as x and y values to give to window.scrollTo
@ -550,54 +658,27 @@ export function scrollto(a: number, b: number | "x" | "y" = "y") {
window.scrollTo(window.scrollX, percentage * elem.scrollHeight / 100)
if (top == elem.getClientRects()[0].top && (percentage == 0 || percentage == 100)) {
// scrollTo failed, if the user wants to go to the top/bottom of
// the page try recursiveScroll instead
recursiveScroll(window.scrollX, 1073741824 * (percentage == 0 ? -1 : 1), [window.document.body])
// the page try scrolling.recursiveScroll instead
scrolling.recursiveScroll(window.scrollX, 1073741824 * (percentage == 0 ? -1 : 1), [document.documentElement])
}
} else if (b === "x") {
let left = elem.getClientRects()[0].left
window.scrollTo(percentage * elem.scrollWidth / 100, window.scrollY)
if (left == elem.getClientRects()[0].left && (percentage == 0 || percentage == 100)) {
recursiveScroll(1073741824 * (percentage == 0 ? -1 : 1), window.scrollX, [window.document.body])
scrolling.recursiveScroll(1073741824 * (percentage == 0 ? -1 : 1), window.scrollX, [document.documentElement])
}
} else {
window.scrollTo(a, Number(b)) // a,b numbers
}
}
/** Tries to find a node which can be scrolled either x pixels to the right or
* y pixels down among the Elements in {nodes} and children of these Elements.
*
* This function used to be recursive but isn't anymore due to various
* attempts at optimizing the function in order to reduce GC pressure.
*/
//#content_helper
function recursiveScroll(x: number, y: number, nodes: Element[]) {
let index = 0
do {
let node = nodes[index++] as any
// Save the node's position
let top = node.scrollTop
let left = node.scrollLeft
node.scrollBy(x, y)
// if the node moved, stop
if (top != node.scrollTop || left != node.scrollLeft) return
// Otherwise, add its children to the nodes that could be scrolled
nodes = nodes.concat(Array.from(node.children))
if (node.contentDocument) nodes.push(node.contentDocument.body)
} while (index < nodes.length)
}
//#content
export function scrollline(n = 1) {
let top = document.body.getClientRects()[0].top
window.scrollByLines(n)
if (top == document.body.getClientRects()[0].top) {
const cssHeight = window.getComputedStyle(document.body).getPropertyValue("line-height")
// Remove the "px" at the end
const lineHeight = parseInt(cssHeight.substr(0, cssHeight.length - 2))
// lineHeight probably can't be NaN but let's make sure
if (lineHeight) recursiveScroll(0, lineHeight * n, [window.document.body])
}
if (lineHeight) scrolling.recursiveScroll(0, lineHeight * n, [document.documentElement])
}
//#content
@ -747,12 +828,13 @@ export function viewsource(url = "") {
}
}
/** Go to your homepage(s)
@param all
- if "true", opens all homepages in new tabs
- if "false" or not given, opens the last homepage in the current tab
/**
* Go to the homepages you have set with `set home [url1] [url2]`.
*
* @param all
* - if "true", opens all homepages in new tabs
* - if "false" or not given, opens the last homepage in the current tab
*
*/
//#background
export function home(all: "false" | "true" = "false") {
@ -792,6 +874,15 @@ export async function tutor(newtab?: string) {
else open(tutor)
}
/**
* Display Tridactyl's contributors in order of commits in a user-friendly fashion
*/
//#background
export async function credits(excmd?: string) {
const creditspage = browser.extension.getURL("static/authors.html")
tabopen(creditspage)
}
/** @hidden */
// Find clickable next-page/previous-page links whose text matches the supplied pattern,
// and return the last such link.
@ -1306,8 +1397,13 @@ export async function tabopen(...addressarr: string[]) {
let address = addressarr.join(" ")
if (!ABOUT_WHITELIST.includes(address) && address.match(/^(about|file):.*/)) {
if ((await browser.runtime.getPlatformInfo()).os === "mac" && (await browser.windows.getCurrent()).incognito) {
fillcmdline_notrail("# nativeopen isn't supported in private mode on OSX. Consider installing Linux or Windows :).")
return
} else {
nativeopen(address)
return
}
} else if (address != "") url = forceURI(address)
else url = forceURI(config.get("newtab"))
@ -1524,9 +1620,14 @@ export async function winopen(...args: string[]) {
} else address = args.join(" ")
createData["url"] = address != "" ? forceURI(address) : forceURI(config.get("newtab"))
if (!ABOUT_WHITELIST.includes(address) && address.match(/^(about|file):.*/)) {
if ((await browser.runtime.getPlatformInfo()).os === "mac") {
fillcmdline_notrail("# nativeopen isn't supported for winopen on OSX. Consider installing Linux or Windows :).")
return
} else {
nativeopen(address, firefoxArgs)
return
}
}
browser.windows.create(createData)
}
@ -1634,7 +1735,7 @@ export function repeat(n = 1, ...exstr: string[]) {
}
/**
* Split `cmds` on pipes (|) and treat each as its own command. Return values are cast to strings and passed to the appended to the arguments of the next ex command, e.g,
* Split `cmds` on pipes (|) and treat each as its own command. Return values are passed as the last argument of the next ex command, e.g,
*
* `composite echo yes | fillcmdline` becomes `fillcmdline yes`. A more complicated example is the ex alias, `command current_url composite get_current_url | fillcmdline_notrail `, which is used in, e.g. `bind T current_url tabopen`.
*
@ -1646,23 +1747,24 @@ export function repeat(n = 1, ...exstr: string[]) {
*/
//#background
export async function composite(...cmds: string[]) {
cmds = cmds.join(" ").split("|")
let val = ""
for (let c of cmds) {
let dmds = c.split(";")
if (dmds.length > 1) {
for (let d of dmds) {
await controller.acceptExCmd(d)
}
} else val = await controller.acceptExCmd(dmds[0] + val)
try {
if (val == undefined || val.includes("undefined")) val = ""
else val = " " + val
return cmds
.join(" ")
.split(";")
.reduce(
async (_, cmd) => {
await _
let cmds = cmd.split("|")
let [fn, args] = excmd_parser.parser(cmd)
return cmds.slice(1).reduce(async (pipedValue, cmd) => {
let [fn, args] = excmd_parser.parser(cmd)
return fn.call({}, ...args, await pipedValue)
}, fn.call({}, ...args))
},
null as any,
)
} catch (e) {
if (e instanceof TypeError) {
val = " " + val
} else throw e
}
logger.error(e)
}
}
@ -1894,7 +1996,7 @@ export function searchsetkeyword(keyword: string, url: string) {
/** Set a key value pair in config.
Use to set any string values found [here](/static/docs/modules/_config_.html#defaults)
Use to set any string values found [here](/static/docs/modules/_src_config_.html#defaults)
e.g.
set searchurls.google https://www.google.com/search?q=
@ -2411,19 +2513,32 @@ export async function echo(...str: string[]) {
*
* Aliased to `!js`
*
* If you want to pipe an argument to `js`, you need to use the "-p" flag and then use the JS_ARG global variable, e.g:
*
* `composite get_current_url | js -p alert(JS_ARG)`
*/
//#content
export async function js(...str: string[]) {
if (str[0].startsWith("-p")) {
let JS_ARG = str[str.length - 1]
return eval(str.slice(1, -1).join(" "))
} else {
return eval(str.join(" "))
}
}
/**
* Lets you execute JavaScript in the background context. All the help from [[js]] applies. Gives you a different `tri` object.
*/
//#background
export async function jsb(...str: string[]) {
if (str[0].startsWith("-p")) {
let JS_ARG = str[str.length - 1]
return eval(str.slice(1, -1).join(" "))
} else {
return eval(str.join(" "))
}
}
/** Open a welcome page on first install.
*

View file

@ -259,7 +259,7 @@ function buildHintsVimperator(els: Element[], onSelect: HintSelectedCallback) {
const escapedHintChars = config
.get("hintchars")
.replace(/^\^|[-\\\]]/g, "\\$&")
const filterableTextFilter = new RegExp("[" + escapedHintChars + "]", "gi")
const filterableTextFilter = new RegExp("[" + escapedHintChars + "]", "g")
for (let [el, name] of izip(els, names)) {
let ft = elementFilterableText(el)
// strip out hintchars
@ -401,7 +401,7 @@ function reset() {
/** If key is in hintchars, add it to filtstr and filter */
function pushKey(ke) {
if (hasModifiers(ke)) {
if (ke.ctrlKey || ke.altKey || ke.metaKey) {
return
} else if (ke.key === "Backspace") {
modeState.filter = modeState.filter.slice(0, -1)
@ -409,6 +409,7 @@ function pushKey(ke) {
} else if (ke.key.length > 1) {
return
} else if (modeState.hintchars.includes(ke.key)) {
console.log(ke.key)
modeState.filter += ke.key
modeState.filterFunc(modeState.filter)
}

View file

@ -56,9 +56,7 @@ export class Logger {
return browser.runtime.sendMessage({
type: "commandline_background",
command: "recvExStr",
args: [
"fillcmdline # Error: " + message.join(" "),
],
args: ["fillcmdline # " + message.join(" ")],
})
else
return browser.tabs.sendMessage(
@ -69,7 +67,7 @@ export class Logger {
{
type: "commandline_frame",
command: "fillcmdline",
args: ["# Error: " + message.join(" ")],
args: ["# " + message.join(" ")],
},
)
}

View file

@ -409,12 +409,15 @@ export async function loadPrefs(filename): Promise<{ [key: string]: string }> {
return parsePrefs(result.content)
}
let cached_prefs = null
/** Returns a promise for an object that should contain every about:config
* setting. If performance is slow, it might be a good idea to cache the
* results of this function: the preference files do not change while firefox
* is running.
* setting.
*
* Performance is slow so we need to cache the results.
*/
export async function getPrefs(): Promise<{ [key: string]: string }> {
if (cached_prefs != null) return cached_prefs
const profile = (await getProfileDir()) + "/"
const prefFiles = [
// Debian has these
@ -444,7 +447,10 @@ export async function getPrefs(): Promise<{ [key: string]: string }> {
for (let file of prefFiles) {
promises.push(loadPrefs(file))
}
return promises.reduce(async (a, b) => Object.assign(await a, await b))
cached_prefs = promises.reduce(async (a, b) =>
Object.assign(await a, await b),
)
return cached_prefs
}
/** Returns the value for the corresponding about:config setting */
@ -452,8 +458,42 @@ export async function getPref(name: string): Promise<string> {
return (await getPrefs())[name]
}
/** Fetches a config option from the config. If the option is undefined, fetch
* a preference from preferences. It would make more sense for this function to
* be in config.ts but this would require importing this file in config.ts and
* Webpack doesn't like circular dependencies.
*/
export async function getConfElsePref(
confName: string,
prefName: string,
): Promise<any> {
let option = await config.getAsync(confName)
if (option === undefined) {
try {
option = await getPref(prefName)
} catch (e) {}
}
return option
}
/** Fetches a config option from the config. If the option is undefined, fetch
* prefName from the preferences. If prefName is undefined too, return a
* default.
*/
export async function getConfElsePrefElseDefault(
confName: string,
prefName: string,
def: any,
): Promise<any> {
let option = await getConfElsePref(confName, prefName)
if (option === undefined) return def
return option
}
/** Writes a preference to user.js */
export async function writePref(name: string, value: any) {
if (cached_prefs) cached_prefs[name] = value
if (typeof value == "string") value = `"${value}"`
const file = (await getProfileDir()) + "/user.js"
// No need to check the return code because read returns "" when failing to

162
src/scrolling.ts Normal file
View file

@ -0,0 +1,162 @@
import * as Native from "./native_background"
type scrollingDirection = "scrollLeft" | "scrollTop"
// Stores elements that are currently being horizontally scrolled
let horizontallyScrolling = new Map()
// Stores elements that are currently being vertically scrolled
let verticallyScrolling = new Map()
async function getSmooth() {
return await Native.getConfElsePrefElseDefault(
"smoothscroll",
"general.smoothScroll",
"false",
)
}
async function getDuration() {
return await Native.getConfElsePrefElseDefault(
"scrollduration",
"general.smoothScroll.lines.durationMinMs",
100,
)
}
class ScrollingData {
// time at which the scrolling animation started
startTime: number
// Starting position of the element. This shouldn't ever change.
startPos: number
// Where the element should end up. This can change if .scroll() is called
// while a scrolling animation is already running
endPos: number
// Whether the element is being scrolled
scrolling = false
// Duration of the scrolling animation
duration = 0
/** elem: The element that should be scrolled
* pos: "scrollLeft" if the element should be scrolled on the horizontal axis, "scrollTop" otherwise
*/
constructor(
private elem: HTMLElement,
private pos: scrollingDirection = "scrollTop",
) {}
/** Computes where the element should be.
* This changes depending on how long ago the first scrolling attempt was
* made.
* It might be useful to make this function more configurable by making it
* accept an argument instead of using performance.now()
*/
getStep() {
if (this.startTime === undefined) {
this.startTime = performance.now()
}
let elapsed = performance.now() - this.startTime
// If the animation should be done, return the position the element should have
if (elapsed > this.duration || this.elem[this.pos] == this.endPos)
return this.endPos
let result = (this.endPos - this.startPos) * elapsed / this.duration
if (result >= 1 || result <= -1) return this.startPos + result
return this.elem[this.pos] + (this.startPos < this.endPos ? 1 : -1)
}
/** Updates the position of this.elem */
scrollStep() {
let val = this.elem[this.pos]
this.elem[this.pos] = this.getStep()
return val != this.elem[this.pos]
}
/** Calls this.scrollStep() until the element has been completely scrolled
* or the scrolling animation is complete */
scheduleStep() {
// If scrollStep() scrolled the element, reschedule a step
// Otherwise, register that the element stopped scrolling
window.requestAnimationFrame(
() =>
this.scrollStep()
? this.scheduleStep()
: (this.scrolling = false),
)
}
scroll(distance: number, duration: number) {
this.startTime = performance.now()
this.startPos = this.elem[this.pos]
this.endPos = this.elem[this.pos] + distance
this.duration = duration
// If we're already scrolling we don't need to try to scroll
if (this.scrolling) return true
this.scrolling = this.scrollStep()
if (this.scrolling)
// If the element can be scrolled, scroll until animation completion
this.scheduleStep()
return this.scrolling
}
}
/** Tries to scroll e by x and y pixel, make the smooth scrolling animation
* last duration milliseconds
*/
export async function scroll(
x: number,
y: number,
e: HTMLElement,
duration: number = undefined,
) {
let smooth = await getSmooth()
if (smooth == "false") duration = 0
else if (duration === undefined) duration = await getDuration()
let result = false
if (x != 0) {
// Don't create a new ScrollingData object if the element is already
// being scrolled
let scrollData = horizontallyScrolling.get(e)
if (!scrollData || !scrollData.scrolling)
scrollData = new ScrollingData(e, "scrollLeft")
horizontallyScrolling.set(e, scrollData)
result = result || scrollData.scroll(x, duration)
}
if (y != 0) {
let scrollData = verticallyScrolling.get(e)
if (!scrollData || !scrollData.scrolling)
scrollData = new ScrollingData(e, "scrollTop")
verticallyScrolling.set(e, scrollData)
result = result || scrollData.scroll(y, duration)
}
return result
}
/** Tries to find a node which can be scrolled either x pixels to the right or
* y pixels down among the Elements in {nodes} and children of these Elements.
*
* This function used to be recursive but isn't anymore due to various
* attempts at optimizing the function in order to reduce GC pressure.
*/
export async function recursiveScroll(
x: number,
y: number,
nodes: Element[],
duration: number = undefined,
) {
// Determine whether to smoothscroll or not
let smooth = await getSmooth()
if (smooth == "false") duration = 0
else if (duration === undefined) duration = await getDuration()
let index = 0
let now = performance.now()
do {
let node = nodes[index++] as any
// Save the node's position
if (await scroll(x, y, node, duration)) return
// Otherwise, add its children to the nodes that could be scrolled
nodes = nodes.concat(Array.from(node.children))
if (node.contentDocument) nodes.push(node.contentDocument.body)
} while (index < nodes.length)
}

23
src/static/authors.html Normal file
View file

@ -0,0 +1,23 @@
<!doctype html>
<html lang="en" class="TridactylOwnNamespace">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/content.css">
<link rel="stylesheet" href="css/viewsource.css">
<link rel="stylesheet" href="css/authors.css">
<link rel="shortcut icon" href="logo/Tridactyl_64px.png">
</head>
<div class="fade"></div>
<section class="star-wars">
<div class="crawl">
<h2>Tridactyl: The Return of The Ed-i</h2>
<br />
<h3>The version of Tridactyl you are using was made by the following people:</h3>
REPLACETHIS
</div>
</section>
<script src="../content.js"></script>
</html>

View file

@ -2,19 +2,19 @@
Command mode, i.e, "the console", is used for accessing less frequently used commands, such as:
- `tabdetach` to detach the current tab into a new window
- `bind [key] [excommand]` to bind keys
- `viewsource` to view the current page's source
- `viewconfig nmaps` to view the current normal mode bindings
- `help [command]` to access help on a command
- `composite [command 1]; [command 2]; [command 3]...` lets you execute commands sequentially, useful for binding. If you want the results of each command to be piped to the other, use pipes `|` instead of semi-colons.
* `tabdetach` to detach the current tab into a new window
* `bind [key] [excommand]` to bind keys
* `viewsource` to view the current page's source
* `viewconfig nmaps` to view the current normal mode bindings
* `help [command]` to access help on a command
* `composite [command 1]; [command 2]; [command 3]...` lets you execute commands sequentially, useful for binding. If you want the results of each command to be piped to the other, use pipes `|` instead of semi-colons.
We support a handful of keybinds in the console:
- `Ctrl-C` to exit to normal mode, or copy selected text.
- `Up`/`Down` to search in command history: e.g. `:tabopen` `Up` will show you the most recent tabopen command.
- `Tab`/`Shift-Tab` cycle completion, enter to select
- `Ctrl-F` to complete the command from command history
- `Space` to insert the URL of the highlighted completion into the command line
* `Ctrl-C` to exit to normal mode, or copy selected text.
* `Up`/`Down` to search in command history: e.g. `:tabopen` `Up` will show you the most recent tabopen command.
* `Tab`/`Shift-Tab` cycle completion, enter to select
* `Ctrl-F` to complete the command from command history
* `Space` to insert the URL of the highlighted completion into the command line
The [next page](./settings.html) will talk about the various settings available.

View file

@ -2,9 +2,9 @@
You can get help about any command by typing `help [command]` in command mode. Additionally,
- If you want to know what a key is bound to, you can simply type `bind [key]` and you will be told the ex command.
- You can view all of your config on `viewconfig` (but Tridactyl can't run on this page: `Alt-LeftArrow` will get you back to your previous page).
- If you want to know the value of a setting, `get [setting]`, for example `get nmaps`.
* If you want to know what a key is bound to, you can simply type `bind [key]` and you will be told the ex command.
* You can view all of your config on `viewconfig` (but Tridactyl can't run on this page: `Alt-LeftArrow` will get you back to your previous page).
* If you want to know the value of a setting, `get [setting]`, for example `get nmaps`.
Lastly, you can contact the developers via Matrix or GitHub, as mentioned on the new tab page.

View file

@ -1,14 +1,14 @@
# Hint mode
There are many different hint submodes. They all follow a similar pattern: hinting modes display characters above various elements on the screen, which you can type to perform actions using those elements.
There are many different hint submodes. They all follow a similar pattern: hinting modes display characters above various elements on the screen, which you can type to perform actions using those elements. (Note: hint characters should be typed in lowercase.)
Here are some of the most useful hint modes:
- `:hint -b` or `F`: open link in background
- `:hint -y` or `;y`: copy link location to clipboard
- `:hint -p` or `;p`: copy element text (such as a paragraph) to clipboard
- `:hint -#` or `;#`: copy anchor location. Useful for linking someone to a specific part of a page.
- `:hint -k` or `;k`: kill an element. Very satisfying.
* `:hint -b` or `F`: open link in background
* `:hint -y` or `;y`: copy link location to clipboard
* `:hint -p` or `;p`: copy element text (such as a paragraph) to clipboard
* `:hint -#` or `;#`: copy anchor location. Useful for linking someone to a specific part of a page.
* `:hint -k` or `;k`: kill an element. Very satisfying.
If there is ever only a single hint remaining (for example, because you have wittled them down, or there is only a single link visible on the page) the hint mode will follow it automatically.

View file

@ -12,20 +12,19 @@ Many keypresses in normal mode take you into another mode. `t`, for example, put
## Useful normal mode keybinds
- `b` brings up a list of your current tabs. Press `Tab`/`Shift-Tab` to cycle through them and enter to select. You can also type to filter down the tabs based on their titles and URLs
- Opening web pages:
- `w` opens URLs in new windows
- `o` in the current tab
- `t` in a new tab
- Using a capital letter in place of any of the previous commands opens the command with the current URL pasted into it, i.e, `W`,`O`,`T`
- `s` lets you search easily
- in general, you can search many search engines straight from these prompts by simply starting your query with the search engine, such as `bing` `duckduckgo` or `scholar`
- Navigate history with `H` and `L`
- `yy` copies the current URL to your clipboard
- `p` opens the clipboard contents as a web page, or searches for it, in the current tab. `P` opens it in a new tab
- Protip: quickly search for the source of a quote by using `;p` to copy a paragraph, and `P` to search the internet for it
- `zi`,`zo`,`zz` zoom in, out and return to the default zoom
* `b` brings up a list of your current tabs. Press `Tab`/`Shift-Tab` to cycle through them and enter to select. You can also type to filter down the tabs based on their titles and URLs
* Opening web pages:
* `w` opens URLs in new windows
* `o` in the current tab
* `t` in a new tab
* Using a capital letter in place of any of the previous commands opens the command with the current URL pasted into it, i.e, `W`,`O`,`T`
* `s` lets you search easily
* in general, you can search many search engines straight from these prompts by simply starting your query with the search engine, such as `bing` `duckduckgo` or `scholar`
* Navigate history with `H` and `L`
* `yy` copies the current URL to your clipboard
* `p` opens the clipboard contents as a web page, or searches for it, in the current tab. `P` opens it in a new tab
* Protip: quickly search for the source of a quote by using `;p` to copy a paragraph, and `P` to search the internet for it
* `zi`,`zo`,`zz` zoom in, out and return to the default zoom
All the keys in normal mode are bound to commands; for example, `j` is bound to `scrolline 10`. If you are ever curious as to what a key sequence does in normal mode, you can simply use `:bind [keys]` and the command line will tell you to which command they are bound.

View file

@ -6,16 +6,16 @@ Currently, you can view settings on `help` next to the commands that they affect
Here we will briefly summarise some of the main settings:
- nmaps
- these are all of the keybinds in normal mode
- searchengine
- the default search engine to use. You can choose any from the searchurls setting, or add your own.
- hintfiltermode
- the style of hint mode to use. Set it to "vimperator" to filter links by typing in the text they display
- You will also want to change the hintchars setting to something that allows you to type in most text, e.g, 5432167890.
- theme
- dark or default
- excmds
- aliases for command mode: the things on the left actually run the commands on the right. The most interesting one of these is `current_url`, which is how the binds for O, W and T (`bind T`) work.
* nmaps
* these are all of the keybinds in normal mode
* searchengine
* the default search engine to use. You can choose any from the searchurls setting, or add your own.
* hintfiltermode
* the style of hint mode to use. Set it to "vimperator" to filter links by typing in the text they display
* You will also want to change the hintchars setting to something that allows you to type in most text, e.g, 5432167890.
* theme
* dark or default
* excmds
* aliases for command mode: the things on the left actually run the commands on the right. The most interesting one of these is `current_url`, which is how the binds for O, W and T (`bind T`) work.
The <a href='./help.html' rel='next'>final page</a> describes how you can get further help.

View file

@ -12,20 +12,21 @@ It will not cover advanced topics. For those, [`:help`](../docs/modules/_excmds_
The idea behind Tridactyl is to allow you to navigate the web more efficiently with just the keyboard. Tridactyl turns Firefox into a modal browser, meaning it has several different modes of operation, like Vim. It can only ever be in one mode at a time, and each of these modes could have a wildly different operation. You can think of it a bit like a Transformer, if you like. There are four main modes you will want to be familiar with:
- Normal mode
- This mode is used for navigating around single pages and starting other modes.
- You are usually in this mode. You can enter normal mode from the other modes by pressing `Escape`.
- Hint mode
- This mode highlights elements on the web page and performs actions on those elements.
- This is most often used for following links, but it has many other submodes.
- You can enter this mode with `f` and exit it with `Escape` or `Enter`.
- Command mode ("ex-mode")
- This mode allows you to execute more complicated commands by typing them out manually.
- It is commonly used for binding keys and accessing help.
- You can enter this mode with `:` and exit it with `Escape` or `Enter`.
- Ignore mode
- This mode passes all keypresses through to the web page. It is useful for websites that have their own keybinds, such as games and Gmail.
- You can toggle the mode with `Shift-Insert`.
* Normal mode
* This mode is used for navigating around single pages and starting other modes.
* You are usually in this mode. You can enter normal mode from the other modes by pressing `Escape`.
* Hint mode
* This mode highlights elements on the web page and performs actions on those elements.
* This is most often used for following links, but it has many other submodes.
* You can enter this mode with `f` and exit it with `Escape` or `Enter`.
* Hint characters are displayed as uppercase letters, but you should type the lowercase letter.
* Command mode ("ex-mode")
* This mode allows you to execute more complicated commands by typing them out manually.
* It is commonly used for binding keys and accessing help.
* You can enter this mode with `:` and exit it with `Escape` or `Enter`.
* Ignore mode
* This mode passes all keypresses through to the web page. It is useful for websites that have their own keybinds, such as games and Gmail.
* You can toggle the mode with `Shift-Insert` or `Ctrl-Alt-Backtick`.
Almost all of the modes are controlled by series of keypresses. In this tutorial, a sequence of keys such as `zz` should be entered by pressing the key `z`, letting go, and then pressing the key `z`. There is no need to hold both keys at once, if that were even possible. (`zz` resets the zoom level to the default, so it probably didn't seem to do anything). Sometimes `help` refers to a command that must be entered in command mode; it should hopefully always be clear from context which we mean.

View file

@ -1,4 +1,5 @@
<html lang="en">
<!doctype html>
<html lang="en" class="TridactylOwnNamespace">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/newtab.css">

View file

@ -0,0 +1,63 @@
/* From https://css-tricks.com/snippets/css/star-wars-crawl-text/ */
body {
width: 100%;
height: 100%;
background: #000;
overflow: hidden;
}
* {
text-align: left !important;
}
.fade {
position: relative;
width: 100%;
min-height: 60vh;
top: -25px;
background-image: linear-gradient(0deg, transparent, black 75%);
z-index: 1;
}
.star-wars {
display: flex;
justify-content: center;
position: relative;
height: 800px;
color: #feda4a;
font-family: "Pathway Gothic One", sans-serif;
font-size: 500%;
font-weight: 600;
letter-spacing: 6px;
line-height: 150%;
perspective: 400px;
text-align: justify;
}
.crawl {
position: relative;
top: 9999px;
transform-origin: 50% 100%;
animation: crawl 90s linear;
}
.crawl > .title {
font-size: 90%;
text-align: center;
}
.crawl > .title h1 {
margin: 0 0 100px;
text-transform: uppercase;
}
@keyframes crawl {
0% {
top: 0;
transform: rotateX(20deg) translateZ(0);
}
100% {
top: -25000px;
transform: rotateX(25deg) translateZ(-10000px);
}
}

View file

@ -33,7 +33,7 @@ input {
}
#tridactyl-colon::before {
content: ":"
content: ":";
}
/* COMPLETIONS */
@ -89,10 +89,17 @@ input {
table-layout: fixed;
}
#completions table tr td:nth-of-type(1) { width: 1.5em; padding-left: 0.5em}
#completions table tr td:nth-of-type(2) { width: 1.5em; }
#completions table tr td:nth-of-type(1) {
width: 1.5em;
padding-left: 0.5em;
}
#completions table tr td:nth-of-type(2) {
width: 1.5em;
}
/* #completions table tr td:nth-of-type(3) { width: 5em; } */
#completions table tr td:nth-of-type(4) { width: 50%; }
#completions table tr td:nth-of-type(4) {
width: 50%;
}
#completions table tr {
white-space: nowrap;
@ -114,13 +121,15 @@ input {
background: linear-gradient(
var(--tridactyl-header-first-bg),
var(--tridactyl-header-second-bg),
var(--tridactyl-header-third-bg));
var(--tridactyl-header-third-bg)
);
font-weight: var(--tridactyl-header-font-weight);
border-bottom: var(--tridactyl-header-border-bottom);
padding-left: 0.5ex;
}
#completions .sectionHeader, #completions .option {
#completions .sectionHeader,
#completions .option {
height: var(--option-height);
line-height: var(--option-height);
}
@ -157,7 +166,8 @@ a.url:hover {
}
/* Pick the .url out especially because otherwise its link styles dominate. */
.focused, .focused .url {
.focused,
.focused .url {
color: var(--tridactyl-of-fg);
background: var(--tridactyl-of-bg);
}

View file

@ -37,7 +37,6 @@
background: #f9f5ff !important;
}
@media print {
.TridactylStatusIndicator {
display: none !important;

View file

@ -8,14 +8,15 @@ span.TridactylHint {
background-color: var(--tridactyl-hintspan-bg) !important;
border-color: var(--tridactyl-hintspan-border-color) !important;
border-width: var(--tridactyl-hintspan-border-width) !important;
min-width: .75em !important;
min-width: 0.75em !important;
border-style: var(--tridactyl-hintspan-border-style) !important;
padding: 0 1pt !important;
text-align: center !important;
z-index: 2147483647 !important;
}
.TridactylHintElem, .TridactylHintActive {
.TridactylHintElem,
.TridactylHintActive {
color: var(--tridactyl-hint-active-fg) !important !important;
animation: none !important;
transition: unset !important;

View file

@ -24,7 +24,7 @@ input[id^="spoiler"] + label {
font-size: 12pt;
border-radius: 2px;
cursor: pointer;
transition: all .6s;
transition: all 0.6s;
}
input[id^="spoiler"]:checked + label {
color: #333;
@ -40,7 +40,7 @@ input[id^="spoiler"] ~ .spoiler {
color: var(--tridactyl-highlight-box-fg);
border: 1px solid #ccc;
border-radius: 2px;
transition: all .6s;
transition: all 0.6s;
}
input[id^="spoiler"]:checked + label + .spoiler {
height: auto;
@ -48,7 +48,6 @@ input[id^="spoiler"]:checked + label + .spoiler{
padding: 10px;
}
h1 {
padding-top: 1em;
}
@ -64,7 +63,8 @@ ul {
padding-right: 20px;
}
p,li {
p,
li {
hyphens: auto;
text-align: justify;
}
@ -87,5 +87,5 @@ img {
display: block;
margin-left: auto;
margin-right: auto;
padding-top: .5em;
padding-top: 0.5em;
}

View file

@ -21,7 +21,6 @@
*
*/
/* auto-hide the tab and navigation bar in a similar way to fullscreen mode */
/* User config */
@ -36,16 +35,22 @@
/* Hide grey container box */
:root:not([customizing]) #navigator-toolbox:not(:hover):not(:focus-within) {
max-height: 0;
min-height: calc(0px); /* I have no idea why just using 0 or 0px does not work... */
min-height: calc(
0px
); /* I have no idea why just using 0 or 0px does not work... */
}
/* Auto hide tab bar */
:root:not([customizing]) #navigator-toolbox:not(:hover):not(:focus-within) #TabsToolbar {
:root:not([customizing])
#navigator-toolbox:not(:hover):not(:focus-within)
#TabsToolbar {
visibility: collapse;
}
/* Auto hide nav bar */
:root:not([customizing]) #navigator-toolbox:not(:hover):not(:focus-within) #nav-bar {
:root:not([customizing])
#navigator-toolbox:not(:hover):not(:focus-within)
#nav-bar {
max-height: 0;
min-height: 0 !important;
/* Use margin-bottom to allow trigger zones that are larger than the nav-bar */
@ -59,7 +64,6 @@
background-color: rgb(232, 232, 231);
}
/* Make top bar more compact */
/* Make nav-bar thinner */
@ -75,14 +79,24 @@
/* Hide URL notifications that aren't particularly useful and cover up the command line
* TODO: move it above the command line / bring functionality into status line like Vimperator */
statuspanel[type="overLink"]{display: none !important;}
statuspanel[type="overLink"] {
display: none !important;
}
/* Partial removal of black bottom 1px line shown in fullscreen mode */
#navigator-toolbox::after { display: none !important; }
#navigator-toolbox::after {
display: none !important;
}
/* Kill tab bar */
#TabsToolbar { visibility: collapse; }
#TabsToolbar {
visibility: collapse;
}
/* Remove window decorations (Close, Minimize, Fullscreen) */
#titlebar { display: none !important; }
#TabsToolbar .titlebar-placeholder { display: none !important; }
#titlebar {
display: none !important;
}
#TabsToolbar .titlebar-placeholder {
display: none !important;
}

View file

@ -4,47 +4,46 @@
Tridactyl has to override your new tab page due to WebExtension limitations. You can learn how to change it at the bottom of the page, otherwise please read on for some tips and tricks.
- You can view the main help page by typing [`:help`][help], and access the tutorial with [`:tutor`][tutor].
* You can view the main help page by typing [`:help`][help], and access the tutorial with [`:tutor`][tutor].
- You can view your current configuration with `:viewconfig`.
* You can view your current configuration with `:viewconfig`.
- You can contact the developers, other users and contributors for support or whatever on [Matrix][matrix-link], [Gitter][gitter-link], or [IRC][freenode-link].
* You can contact the developers, other users and contributors for support or whatever on [Matrix][matrix-link], [Gitter][gitter-link], or [IRC][freenode-link].
- If you're enjoying Tridactyl (or not), please leave a review on [addons.mozilla.org][amo].
- **Breaking change to `composite`:** composite now tries to pass the return value from each preceding function to its ancestor. This might break some of your binds to composite, or cause them to act in unexpected ways.
- **NB:** Tridactyl can now run external programs on Linux and OSX if you decide to install an additional executable. Just run `:installnative` to get going, and then Ctrl-i `<C-i>` in a text box to open your editor.
* If you're enjoying Tridactyl (or not), please leave a review on [addons.mozilla.org][amo].
* **Breaking change to `composite`:** composite now tries to pass the return value from each preceding function to its ancestor. This might break some of your binds to composite, or cause them to act in unexpected ways.
* **NB:** Tridactyl can now run external programs on Linux and OSX if you decide to install an additional executable. Just run `:installnative` to get going, and then Ctrl-i `<C-i>` in a text box to open your editor.
REPLACE_ME_WITH_THE_CHANGE_LOG_USING_SED
## Highlighted features:
- `f`/`F` — enter the "hint mode" to select a link to follow. `F` to open it in a background tab.
- `Shift` + `Insert` — enter "ignore mode" to send all key presses to the web page you are on. Press `Shift` + `Insert` again to return to the highly productive "normal mode".
- `H`/`L` — go back/forward in the history.
- `o`/`O` — open a URL in this tab (`O` to pre-load current URL).
- `t`/`T` — open a URL in a new tab (`T` to pre-load current URL).
- `gt`/`gT` — go to the next/previous tab.
- `d` — close the current tab.
- `/` — open the find search box.
- `A` — bookmark the current page
- `b` — bring up a list of open tabs in the current window.
- `s` — if you want to search for something that looks like a domain name or URL.
- `gi` — scroll to and focus the last-used input on the page.
- `gr` — open Firefox reader mode (note: Tridactyl will not work in this mode).
- Bind your own commands with, e.g., `:bind J tabprev`. Type `:help bind` to see help on custom binds.
- `yy` — copy the current page URL to your clipboard.
- `[[`/`]]` — navigate forward/backward though paginated pages.
- `ZZ` — close all tabs and windows, but it will only "save" them if your about:preferences are set to "show your tabs and windows from last time".
- [`:help hint`][help-hint] to see all the other useful hint modes (this is the `f` magic. :) ).
* `f`/`F` — enter the "hint mode" to select a link to follow. `F` to open it in a background tab. (Note: hint characters should be typed in lowercase.)
* `Shift` + `Insert` — enter "ignore mode" to send all key presses to the web page you are on. Press `Shift` + `Insert` again to return to the highly productive "normal mode".
* `H`/`L` — go back/forward in the history.
* `o`/`O` — open a URL in this tab (`O` to pre-load current URL).
* `t`/`T` — open a URL in a new tab (`T` to pre-load current URL).
* `gt`/`gT` — go to the next/previous tab.
* `d` — close the current tab.
* `/` — open the find search box.
* `A` — bookmark the current page
* `b` — bring up a list of open tabs in the current window.
* `s` — if you want to search for something that looks like a domain name or URL.
* `gi` — scroll to and focus the last-used input on the page.
* `gr` — open Firefox reader mode (note: Tridactyl will not work in this mode).
* Bind your own commands with, e.g., `:bind J tabprev`. Type `:help bind` to see help on custom binds.
* `yy` — copy the current page URL to your clipboard.
* `[[`/`]]` — navigate forward/backward though paginated pages.
* `ZZ` — close all tabs and windows, but it will only "save" them if your about:preferences are set to "show your tabs and windows from last time".
* [`:help hint`][help-hint] to see all the other useful hint modes (this is the `f` magic. :) ).
## Important limitations due to WebExtensions
- You can only navigate to most about:*\file:* pages if you have Tridactyl's native executable installed.
- Firefox will not load Tridactyl on addons.mozilla.org, about:\*, some file:\* URIs, view-source:\*, or data:\*. On these pages Ctrl-L (or F6), Ctrl-Tab and Ctrl-W are your escape hatches.
- You can change the Firefox GUI with `guiset` (e.g. `guiset gui none` and then `restart`) if you have the native messenger installed, or you can do it yourself by changing your userChrome. There is an example file available on our repository [[2]].
- Tridactyl cannot capture key presses until web pages are loaded. You can use `:reloadall` to reload all tabs to make life more bearable, or flip `browser.sessionstore.restore_tabs_lazily` to false in `about:config`.
* You can only navigate to most about:_\file:_ pages if you have Tridactyl's native executable installed.
* Firefox will not load Tridactyl on addons.mozilla.org, about:\*, some file:\* URIs, view-source:\*, or data:\*. On these pages Ctrl-L (or F6), Ctrl-Tab and Ctrl-W are your escape hatches.
* You can change the Firefox GUI with `guiset` (e.g. `guiset gui none` and then `restart`) if you have the native messenger installed, or you can do it yourself by changing your userChrome. There is an example file available on our repository [[2]].
* Tridactyl cannot capture key presses until web pages are loaded. You can use `:reloadall` to reload all tabs to make life more bearable, or flip `browser.sessionstore.restore_tabs_lazily` to false in `about:config`.
## Why do I see this here?
@ -52,8 +51,8 @@ Tridactyl overrides your newtab page because it cannot insert its content script
### How can I get rid of it?
- `:set newtab [URL]`
- e.g, `:set newtab about:blank`
* `:set newtab [URL]`
* e.g, `:set newtab about:blank`
## FAQ
@ -70,9 +69,9 @@ You have more questions? Have a look at our [FAQ][faq-link].
</div>
[faq-link]: https://github.com/cmcaine/tridactyl#frequently-asked-questions
[help]: /static/docs/modules/_excmds_.html
[help]: /static/docs/modules/_src_excmds_.html
[tutor]: /static/clippy/tutor.html
[help-hint]: /static/docs/modules/_excmds_.html#hint
[help-hint]: /static/docs/modules/_src_excmds_.html#hint
[gitter-badge]: /static/badges/gitter-badge.svg
[gitter-link]: https://gitter.im/tridactyl/Lobby
[freenode-badge]: /static/badges/freenode-badge.svg

View file

@ -1,5 +1,4 @@
:root.TridactylThemeDark {
/* {{{ photon-colours */
/* From https://github.com/overdodactyl/ShadowFox/blob/7dbe9343da87bde804e8fb88dd3b5eaaeb4817b2/css/common-files/color_variables.css */
@ -54,13 +53,13 @@
--tridactyl-photon-colours-grey-80: #2a2a2e;
--tridactyl-photon-colours-grey-90: #0c0c0d;
--tridactyl-photon-colours-code-green: #86de74 !important;
--tridactyl-photon-colours-warning-color: #FCE19F;
--tridactyl-photon-colours-warning-background-color: #44391F;
--tridactyl-photon-colours-theme-highlight-green: #86DE74;
--tridactyl-photon-colours-theme-highlight-blue: #75BFFF;
--tridactyl-photon-colours-theme-highlight-purple: #B98EFF;
--tridactyl-photon-colours-theme-highlight-red: #FF7DE9;
--tridactyl-photon-colours-theme-highlight-yellow: #FFF89E;
--tridactyl-photon-colours-warning-color: #fce19f;
--tridactyl-photon-colours-warning-background-color: #44391f;
--tridactyl-photon-colours-theme-highlight-green: #86de74;
--tridactyl-photon-colours-theme-highlight-blue: #75bfff;
--tridactyl-photon-colours-theme-highlight-purple: #b98eff;
--tridactyl-photon-colours-theme-highlight-red: #ff7de9;
--tridactyl-photon-colours-theme-highlight-yellow: #fff89e;
--tridactyl-photon-colours-theme-highlight-bluegrey: #5e88b0;
--tridactyl-photon-colours-theme-highlight-lightorange: #d99b28;
--tridactyl-photon-colours-theme-highlight-orange: #d96629;
@ -74,57 +73,155 @@
--tridactyl-photon-colours-tone-7: var(--tridactyl-photon-colours-grey-70);
--tridactyl-photon-colours-tone-8: var(--tridactyl-photon-colours-grey-80);
--tridactyl-photon-colours-tone-9: var(--tridactyl-photon-colours-grey-90);
--tridactyl-photon-colours-accent-1: var(--tridactyl-photon-colours-blue-40);
--tridactyl-photon-colours-accent-2: var(--tridactyl-photon-colours-blue-50);
--tridactyl-photon-colours-accent-3: var(--tridactyl-photon-colours-blue-60);
--tridactyl-photon-colours-in-content-page-color: var(--tridactyl-photon-colours-tone-4)!important;
--tridactyl-photon-colours-in-content-page-background: var(--tridactyl-photon-colours-tone-7)!important;
--tridactyl-photon-colours-in-content-text-color: var(--tridactyl-photon-colours-tone-3)!important;
--tridactyl-photon-colours-in-content-selected-text: var(--tridactyl-photon-colours-tone-1)!important;
--tridactyl-photon-colours-in-content-box-background: var(--tridactyl-photon-colours-tone-6)!important;
--tridactyl-photon-colours-accent-1: var(
--tridactyl-photon-colours-blue-40
);
--tridactyl-photon-colours-accent-2: var(
--tridactyl-photon-colours-blue-50
);
--tridactyl-photon-colours-accent-3: var(
--tridactyl-photon-colours-blue-60
);
--tridactyl-photon-colours-in-content-page-color: var(
--tridactyl-photon-colours-tone-4
) !important;
--tridactyl-photon-colours-in-content-page-background: var(
--tridactyl-photon-colours-tone-7
) !important;
--tridactyl-photon-colours-in-content-text-color: var(
--tridactyl-photon-colours-tone-3
) !important;
--tridactyl-photon-colours-in-content-selected-text: var(
--tridactyl-photon-colours-tone-1
) !important;
--tridactyl-photon-colours-in-content-box-background: var(
--tridactyl-photon-colours-tone-6
) !important;
--tridactyl-photon-colours-in-content-box-background-odd: #f3f6fa;
--tridactyl-photon-colours-in-content-box-background-hover: var(--tridactyl-photon-colours-tone-6)!important;
--tridactyl-photon-colours-in-content-box-background-active: var(--tridactyl-photon-colours-tone-6)!important;
--tridactyl-photon-colours-in-content-box-border-color: var(--tridactyl-photon-colours-tone-5)!important;
--tridactyl-photon-colours-in-content-box-background-hover: var(
--tridactyl-photon-colours-tone-6
) !important;
--tridactyl-photon-colours-in-content-box-background-active: var(
--tridactyl-photon-colours-tone-6
) !important;
--tridactyl-photon-colours-in-content-box-border-color: var(
--tridactyl-photon-colours-tone-5
) !important;
--tridactyl-photon-colours-in-content-item-hover: rgba(0, 149, 221, 0.25);
--tridactyl-photon-colours-in-content-item-selected: var(--tridactyl-photon-colours-tone-8)!important;
--tridactyl-photon-colours-in-content-border-highlight: var(--tridactyl-photon-colours-accent-1)!important;
--tridactyl-photon-colours-in-content-border-focus: var(--tridactyl-photon-colours-accent-1)!important;
--tridactyl-photon-colours-in-content-border-color: var(--tridactyl-photon-colours-tone-6)!important;
--tridactyl-photon-colours-in-content-category-outline-focus: 1px dotted #0a84ff;
--tridactyl-photon-colours-in-content-category-text: var(--tridactyl-photon-colours-tone-4)!important;
--tridactyl-photon-colours-in-content-item-selected: var(
--tridactyl-photon-colours-tone-8
) !important;
--tridactyl-photon-colours-in-content-border-highlight: var(
--tridactyl-photon-colours-accent-1
) !important;
--tridactyl-photon-colours-in-content-border-focus: var(
--tridactyl-photon-colours-accent-1
) !important;
--tridactyl-photon-colours-in-content-border-color: var(
--tridactyl-photon-colours-tone-6
) !important;
--tridactyl-photon-colours-in-content-category-outline-focus: 1px dotted
#0a84ff;
--tridactyl-photon-colours-in-content-category-text: var(
--tridactyl-photon-colours-tone-4
) !important;
--tridactyl-photon-colours-in-content-category-text-active: #0c0c0d;
--tridactyl-photon-colours-in-content-category-text-selected: var(--tridactyl-photon-colours-accent-1)!important;
--tridactyl-photon-colours-in-content-category-text-selected: var(
--tridactyl-photon-colours-accent-1
) !important;
--tridactyl-photon-colours-in-content-category-text-selected-active: #0060df;
--tridactyl-photon-colours-in-content-category-background-hover: rgba(12,12,13,0.1);
--tridactyl-photon-colours-in-content-category-background-active: rgba(12,12,13,0.15);
--tridactyl-photon-colours-in-content-category-background-selected-hover: rgba(12,12,13,0.15);
--tridactyl-photon-colours-in-content-category-background-selected-active: rgba(12,12,13,0.2);
--tridactyl-photon-colours-in-content-category-background-hover: rgba(
12,
12,
13,
0.1
);
--tridactyl-photon-colours-in-content-category-background-active: rgba(
12,
12,
13,
0.15
);
--tridactyl-photon-colours-in-content-category-background-selected-hover: rgba(
12,
12,
13,
0.15
);
--tridactyl-photon-colours-in-content-category-background-selected-active: rgba(
12,
12,
13,
0.2
);
--tridactyl-photon-colours-in-content-tab-color: #424f5a;
--tridactyl-photon-colours-in-content-link-color: var(--tridactyl-photon-colours-accent-1)!important;
--tridactyl-photon-colours-in-content-link-color-hover: var(--tridactyl-photon-colours-accent-2)!important;
--tridactyl-photon-colours-in-content-link-color: var(
--tridactyl-photon-colours-accent-1
) !important;
--tridactyl-photon-colours-in-content-link-color-hover: var(
--tridactyl-photon-colours-accent-2
) !important;
--tridactyl-photon-colours-in-content-link-color-active: #003eaa;
--tridactyl-photon-colours-in-content-link-color-visited: #0a8dff;
--tridactyl-photon-colours-in-content-primary-button-background: var(--tridactyl-photon-colours-accent-2)!important;
--tridactyl-photon-colours-in-content-primary-button-background-hover: var(--tridactyl-photon-colours-accent-3)!important;
--tridactyl-photon-colours-in-content-primary-button-background-active: var(--tridactyl-photon-colours-accent-3)!important;
--tridactyl-photon-colours-in-content-table-border-dark-color: var(--tridactyl-photon-colours-tone-7)!important;
--tridactyl-photon-colours-in-content-table-header-background: var(--tridactyl-photon-colours-accent-2)!important;
--tridactyl-photon-colours-theme-selection-background: var(--tridactyl-photon-colours-accent-2)!important;
--tridactyl-photon-colours-theme-selection-background-hover: var(--tridactyl-photon-colours-accent-1)!important;
--tridactyl-photon-colours-in-content-category-header-background: var(--tridactyl-photon-colours-tone-8)!important;
--tridactyl-photon-colours-selected-icon-fill-color: var(--tridactyl-photon-colours-tone-2)!important;
--tridactyl-photon-colours-in-content-dark-header-background: var(--tridactyl-photon-colours-tone-9)!important;
--tridactyl-photon-colours-secure-connection-color: var(--tridactyl-photon-colours-accent-1);
--tridactyl-photon-colours-theme-sidebar-background: #1B1B1D!important;
--tridactyl-photon-colours-cm-background: var(--tridactyl-photon-colours-tone-8)!important;
--tridactyl-photon-colours-in-content-primary-button-background: var(
--tridactyl-photon-colours-accent-2
) !important;
--tridactyl-photon-colours-in-content-primary-button-background-hover: var(
--tridactyl-photon-colours-accent-3
) !important;
--tridactyl-photon-colours-in-content-primary-button-background-active: var(
--tridactyl-photon-colours-accent-3
) !important;
--tridactyl-photon-colours-in-content-table-border-dark-color: var(
--tridactyl-photon-colours-tone-7
) !important;
--tridactyl-photon-colours-in-content-table-header-background: var(
--tridactyl-photon-colours-accent-2
) !important;
--tridactyl-photon-colours-theme-selection-background: var(
--tridactyl-photon-colours-accent-2
) !important;
--tridactyl-photon-colours-theme-selection-background-hover: var(
--tridactyl-photon-colours-accent-1
) !important;
--tridactyl-photon-colours-in-content-category-header-background: var(
--tridactyl-photon-colours-tone-8
) !important;
--tridactyl-photon-colours-selected-icon-fill-color: var(
--tridactyl-photon-colours-tone-2
) !important;
--tridactyl-photon-colours-in-content-dark-header-background: var(
--tridactyl-photon-colours-tone-9
) !important;
--tridactyl-photon-colours-secure-connection-color: var(
--tridactyl-photon-colours-accent-1
);
--tridactyl-photon-colours-theme-sidebar-background: #1b1b1d !important;
--tridactyl-photon-colours-cm-background: var(
--tridactyl-photon-colours-tone-8
) !important;
--tridactyl-photon-colours-cm-selection: #353b48 !important;
--tridactyl-photon-colours-cm-marker: #555 !important;
--tridactyl-photon-colours-cm-linenumber: #58575c !important;
--tridactyl-photon-colours-cm-cursor: #fff !important;
--tridactyl-photon-colours-cm-active-line-background: rgba(185,215,253,.15)!important;
--tridactyl-photon-colours-cm-matching-bracket: rgba(255,255,255,.25)!important;
--tridactyl-photon-colours-cm-search-background: rgba(24,29,32,1)!important;
--tridactyl-photon-colours-cm-active-line-background: rgba(
185,
215,
253,
0.15
) !important;
--tridactyl-photon-colours-cm-matching-bracket: rgba(
255,
255,
255,
0.25
) !important;
--tridactyl-photon-colours-cm-search-background: rgba(
24,
29,
32,
1
) !important;
--tridactyl-photon-colours-cm-red: #de7474 !important;
--tridactyl-photon-colours-start-indicator-for-updater-scripts: black;
--tridactyl-photon-colours-end-indicator-for-updater-scripts: black;
@ -136,7 +233,9 @@
--tridactyl-bg: var(--tridactyl-photon-colours-in-content-page-background);
--tridactyl-cmdl-fg: var(--tridactyl-photon-colours-in-content-text-color);
--tridactyl-cmdl-bg: var(--tridactyl-photon-colours-in-content-category-header-background);
--tridactyl-cmdl-bg: var(
--tridactyl-photon-colours-in-content-category-header-background
);
/* --tridactyl-header-first-bg: var(--tridactyl-photon-colours-in-content-category-header-background); */
/* --tridactyl-header-second-bg: var(--tridactyl-photon-colours-in-content-category-header-background); */
@ -146,7 +245,8 @@
--tridactyl-header-second-bg: #222;
--tridactyl-header-third-bg: #111;
--tridactyl-cmplt-border-top: 1px solid var(--tridactyl-photon-colours-in-content-category-header-background);
--tridactyl-cmplt-border-top: 1px solid
var(--tridactyl-photon-colours-in-content-category-header-background);
--tridactyl-url-fg: var(--tridactyl-photon-colours-code-green);
--tridactyl-url-bg: var(--tridactyl-bg);
@ -157,25 +257,27 @@
/* Hints are not photon coloured. Feel free to experiment with that */
--tridactyl-hintspan-fg: white;
--tridactyl-hintspan-bg: #204E8A;
--tridactyl-hintspan-bg: #204e8a;
--tridactyl-hint-active-fg: #333;
--tridactyl-hint-active-bg: #88FF00;
--tridactyl-hint-active-bg: #88ff00;
--tridactyl-hint-active-outline: 1px solid #000;
--tridactyl-hint-bg: rgba(13, 31, 54, 0.25);
--tridactyl-hint-outline: 1px solid var(--tridactyl-hintspan-bg);
--tridactyl-highlight-box-bg: var(--tridactyl-photon-colours-in-content-box-background);
--tridactyl-highlight-box-fg: var(--tridactyl-photon-colours-in-content-text-color);
--tridactyl-highlight-box-bg: var(
--tridactyl-photon-colours-in-content-box-background
);
--tridactyl-highlight-box-fg: var(
--tridactyl-photon-colours-in-content-text-color
);
}
:root.TridactylThemeDark.TridactylOwnNamespace
input[id^="spoiler"] ~ .spoiler {
:root.TridactylThemeDark.TridactylOwnNamespace input[id^="spoiler"] ~ .spoiler {
border-color: var(--tridactyl-photon-colours-in-content-box-border-color);
}
/* These rules have greater specificity than the rules applying the variables
* above, which causes *issues*. */

View file

@ -1,5 +1,4 @@
:root {
/* Generic */
--tridactyl-font-family: monospace;
--tridactyl-font-family-sans: sans-serif;
@ -30,11 +29,11 @@
/* Element highlights */
--tridactyl-hint-active-fg: var(--tridactyl-fg);
--tridactyl-hint-active-bg: #88FF00;
--tridactyl-hint-active-outline: 1px solid #CC0000;
--tridactyl-hint-active-bg: #88ff00;
--tridactyl-hint-active-outline: 1px solid #cc0000;
--tridactyl-hint-bg: rgba(255, 255, 0, 0.25);
--tridactyl-hint-outline: 1px solid #8F5902;
--tridactyl-hint-outline: 1px solid #8f5902;
/* :viewsource */
--tridactyl-vs-bg: var(--tridactyl-bg);
@ -82,7 +81,6 @@
/* i don't think 0.5px is redered */
--tridactyl-header-border-bottom: 1px solid bottom;
/*url style*/
--tridactyl-url-text-decoration: none;
@ -93,7 +91,7 @@
/*option focused*/
--tridactyl-of-fg: var(--tridactyl-fg);
--tridactyl-of-bg: #FFEC8B;
--tridactyl-of-bg: #ffec8b;
/*new tab spoiler box*/
--tridactyl-highlight-box-bg: #eee;

View file

@ -1,6 +1,7 @@
@font-face {
font-family: 'Aldrich';
font-family: "Aldrich";
font-style: normal;
font-weight: 400;
src: local('Aldrich Regular'), local('Aldrich-Regular'), url('aldrich.ttf') format('truetype');
src: local("Aldrich Regular"), local("Aldrich-Regular"),
url("aldrich.ttf") format("truetype");
}

View file

@ -1,54 +1,44 @@
:root.TridactylThemeGreenmat {
--tridactyl-fg: #00eb00;
--tridactyl-bg: #001500;
--tridactyl-cmdl-fg: #00eb00;
--tridactyl-cmdl-bg: #001500;
--tridactyl-font-family: 'Aldrich';
--tridactyl-font-family: "Aldrich";
--tridactyl-header-first-bg: black;
--tridactyl-header-second-bg: #003500;
--tridactyl-header-third-bg: black;
--tridactyl-cmplt-font-family: 'Aldrich';
--tridactyl-cmplt-font-family: "Aldrich";
--tridactyl-cmplt-fg: var(--tridactyl-cmdl-fg);
--tridactyl-cmplt-bg: rgba(0,0,0,0.90);
--tridactyl-cmplt-bg: rgba(0, 0, 0, 0.9);
--tridactyl-cmplt-border-top: 1px solid var(--tridactyl-cmdl-bg);
--tridactyl-url-fg: var(--tridactyl-cmdl-fg);
--tridactyl-url-bg: none;
--tridactyl-of-fg: #00FF00;
--tridactyl-of-fg: #00ff00;
--tridactyl-of-bg: black;
--tridactyl-highlight-box-bg: black;
--tridactyl-highlight-box-fg: var(--tridactyl-fg);
/*custom theme variables*/
--focused-prefix-color: black;
--focused-border-color: green;
--tridactyl-hintspan-fg: #88FF00;
--tridactyl-hintspan-fg: #88ff00;
--tridactyl-hintspan-bg: black;
--tridactyl-hintspan-font-family: "Aldrich";
--tridactyl-hint-active-fg: #333;
--tridactyl-hint-active-bg: #88FF00;
--tridactyl-hint-active-bg: #88ff00;
--tridactyl-hint-active-outline: 1px solid #000;
--tridactyl-hint-bg: rgba(0, 0, 0, 0.25);
--tridactyl-hint-outline: 2px solid var(--tridactyl-hintspan-bg);
}
/*custom rules over tridactyl default*/
:root.TridactylThemeGreenmat table {
border-collapse: collapse;
}
:root.TridactylThemeGreenmat #completions table tr td {
color: var(--tridactyl-cmplt-fg);
}
:root.TridactylThemeGreenmat #completions .focused {
border-bottom: 1px solid green;
}
@ -58,5 +48,43 @@
background: linear-gradient(
var(--focused-prefix-color),
var(--focused-border-color),
var(--focused-prefix-color));
var(--focused-prefix-color)
);
}
:root.TridactylThemeGreenmat.TridactylOwnNamespace table {
border-collapse: collapse;
}
:root.TridactylThemeGreenmat.TridactylOwnNamespace #completions table tr td {
color: var(--tridactyl-cmplt-fg);
}
/* ### newtab ### */
:root.TridactylThemeGreenmat.TridactylOwnNamespace code {
background-color: rgba(255, 255, 255, 0.1);
border-top: 1px solid var(--tridactyl-fg);
}
:root.TridactylThemeGreenmat.TridactylOwnNamespace ul {
background-color: rgba(0, 0, 0, 0.55);
border-radius: 10px;
border-top: 1px solid var(--tridactyl-fg);
padding-top: 10px;
padding-bottom: 5px;
}
:root.TridactylThemeGreenmat.TridactylOwnNamespace .spoiler > h2 + ul {
background-color: rgba(255, 255, 255, 0.05);
border-radius: 10px;
border-left: 1px solid var(--tridactyl-fg);
border-right: 1px solid var(--tridactyl-fg);
border-top: unset;
border-bottom: unset;
}
:root.TridactylThemeGreenmat.TridactylOwnNamespace a {
color: var(--tridactyl-fg);
font-weight: bold;
}

View file

@ -4,14 +4,15 @@
}
:root.TridactylThemeQuake #completions .sectionHeader {
display: none
display: none;
}
:root.TridactylThemeQuake #tridactyl-colon::before {
content: "] "
content: "] ";
}
:root.TridactylThemeQuake #completions .focused, :root.TridactylThemeQuake #completions .focused .url{
:root.TridactylThemeQuake #completions .focused,
:root.TridactylThemeQuake #completions .focused .url {
background: var(--tridactyl-bg);
text-decoration: underline;
}
@ -22,5 +23,5 @@
top: 0% !important;
left: 0% !important;
box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 15px !important;
opacity: 0.9
opacity: 0.9;
}

View file

@ -37,7 +37,6 @@
/* COMPLETIONS */
:root.TridactylThemeShydactyl #completions {
--option-height: 1.4em;
color: black;
@ -51,7 +50,6 @@
order: 2;
}
/* Olie doesn't know how CSS inheritance works */
:root.TridactylThemeShydactyl #completions .HistoryCompletionSource {
max-height: unset;
@ -71,9 +69,12 @@
min-height: unset;
}
:root.TridactylThemeShydactyl #completions table tr td:nth-of-type(1) { display: none; }
:root.TridactylThemeShydactyl #completions table tr td:nth-of-type(2) { display: none; }
:root.TridactylThemeShydactyl #completions table tr td:nth-of-type(1) {
display: none;
}
:root.TridactylThemeShydactyl #completions table tr td:nth-of-type(2) {
display: none;
}
:root.TridactylThemeShydactyl #completions .BufferCompletionSource table {
width: unset;
font-size: unset;
@ -81,8 +82,9 @@
table-layout: unset;
}
:root.TridactylThemeShydactyl #completions table tr td:nth-of-type(4) { width: 50%; }
:root.TridactylThemeShydactyl #completions table tr td:nth-of-type(4) {
width: 50%;
}
:root.TridactylThemeShydactyl #completions table tr {
white-space: nowrap;
@ -90,7 +92,6 @@
text-overflow: ellipsis;
}
:root.TridactylThemeShydactyl #completions .sectionHeader {
background: unset;
font-weight: 200;
@ -122,7 +123,6 @@
padding: 0.8ex !important;
}
/* #Shydactyl-normal { */
/* border-color: green !important; */
/* } */
@ -130,4 +130,3 @@
/* #Shydactyl-insert { */
/* border-color: yellow !important; */
/* } */

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@ const logger = new Logging.Logger("styling")
// find a way of getting theme list without hard-coding it
// using a macro might be an option
const THEMES = ["dark", "greenmat", "shydactyl"]
const THEMES = ["dark", "greenmat", "shydactyl", "quake"]
function capitalise(str) {
return str[0].toUpperCase() + str.slice(1)

6
src/tridactyl.d.ts vendored
View file

@ -16,6 +16,12 @@ interface Window {
eval(str: string): any
}
// Again, firefox-specific
interface UIEvent {
pageX: number
pageY: number
}
interface HTMLElement {
// Let's be future proof:
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus