Set autocmds to run when certain events happen.
Curently, only 'DocStart' is supported.
The URL on which the events will trigger (currently just uses "contains")
The excmd to run (use composite to run multiple commands)
Navigate back one page in history.
Bind a sequence of keys to an excmd or view bound sequence.
This is an easier-to-implement bodge while we work on vim-style maps.
Examples:
bind G fillcmdline tabopen google
bind D composite tabclose | buffer #
bind j scrollline 20
bind F hint -b
You can view binds by omitting the command line:
bind j
bind k
Use composite if you want to execute multiple excmds. Use fillcmdline to put a string in the cmdline and focus the cmdline (otherwise the string is executed immediately).
See also:
Add or remove a bookmark.
Optionally, you may give the bookmark a title. If no URL is given, a bookmark is added for the current page.
If a bookmark already exists for the URL, it is removed.
Change active tab.
Starts at 1. 0 refers to last tab, -1 to penultimate tab, etc.
"#" means the tab that was last accessed in this window
Equivalent to fillcmdline buffer
Sort of Vimperator alias
Use the system clipboard.
If excmd == "open"
, call open with the contents of the clipboard. Similarly for tabopen.
If excmd == "yank"
, copy the current URL, or if given, the value of toYank, into the system clipboard.
If excmd == "yankcanon"
, copy the canonical URL of the current page if it exists, otherwise copy the current URL.
If excmd == "yankshort"
, copy the shortlink version of the current URL, and fall back to the canonical then actual URL. Known to work on https://yankshort.neocities.org/.
If excmd == "yanktitle"
, copy the title of the open page.
If excmd == "yankmd"
, copy the title and url of the open page formatted in Markdown for easy use on sites such as reddit.
Unfortunately, javascript can only give us the clipboard
clipboard, not e.g. the X selection clipboard.
Similar to vim's comclear
command. Clears an excmd alias defined by
command
.
For example: comclear helloworld
will reverse any changes caused
by command helloworld xxx
See also:
Similar to vim's :command
. Maps one ex-mode command to another.
If command already exists, this will override it, and any new commands
added in a future release will be SILENTLY overridden. Aliases are
expanded recursively.
Examples:
command t tabopen
command tn tabnext_gt
= command hello t
This will expand recursively into 'hello'->'tabopen'Note that this is only for excmd->excmd mappings. To map a normal-mode command to an excommand, see bind.
See also:
Split cmds
on pipes (|) and treat each as its own command.
Workaround: this should clearly be in the parser, but we haven't come up with a good way to deal with |s in URLs, search terms, etc. yet.
Equivalent to fillcmdline_notrail <yourargs><current URL>
See also fillcmdline_notrail
Set the current value of the commandline to string with a trailing space
Set the current value of the commandline to string without a trailing space
Start find mode. Work in progress.
the direction to search in: 1 is forwards, -1 is backwards.
Highlight the next occurence of the previously searched for word.
Focus the last used input on the page
focus the nth input on the page, or "special" inputs: "-l": last focussed input "-n": input after last focussed one "-N": input before last focussed one "-p": first password field "-b": biggest input field
Find a likely next/previous link and follow it
If a link or anchor element with rel=rel exists, use that, otherwise fall back to:
1) find the last anchor on the page with innerText matching the appropriate followpagepattern
.
2) call urlincrement with 1 or -1
If you want to support e.g. French:
set followpagepatterns.next ^(next|newer|prochain)\b|»|>>
set followpagepatterns.prev ^(prev(ious)?|older|précédent)\b|»|>>
the relation of the target page to the current page: "next" or "prev"
Navigate forward one page in history.
Toggle fullscreen state
Puts the contents of config value with keys keys
into the commandline and the background page console
It's a bit rubbish, but we don't have a good way to provide feedback to the commandline yet.
You can view the log entry in the browser console (Ctrl-Shift-j).
For example, you might try get nmaps
to see all of your current binds.
Initialize gobble mode.
It will read nChars
input keys, append them to endCmd
and execute that
string.
Show this page.
:help <excmd>
jumps to the entry for that command.
e.g. :help bind
Hint a page.
bind ;c hint -c [class*="expand"],[class="togg"]
works particularly well on reddit and HNExcepting the custom selector mode and background hint mode, each of these
hint modes is available by default as ;<option character>
, so e.g. ;y
to yank a link's target.
To open a hint in the background, the default bind is F
.
Related settings: "hintchars": "hjklasdfgyuiopqwertnmzxcvb" "hintfiltermode": "simple" | "vimperator" | "vimperator-reflow" "relatedopenpos": "related" | "next" | "last"
Go to your homepage(s)
Set the logging level for a given logging module.
the logging module to set the level on
the level to log at: in increasing verbosity, one of "never", "error", "warning", "info", "debug"
Example:
mode ignore
to ignore all keys.Open a new page in the current tab.
Related settings: "searchengine": "google" or any of [[SEARCH_URLS]]
Pin the current tab
Convenience shortcut for quit.
Convenience shortcut for qall.
Close all windows
Synonym for tabclose.
Opens the current page in Firefox's reader mode. You currently cannot use Tridactyl while in reader mode.
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.
Reload the next n tabs, starting with activeTab, possibly bypassingCache
Reloads all tabs, bypassing the cache if hard is set to true
Reload the next n tabs, starting with activeTab. bypass cache for all
Repeats a cmd
n
times.
Falls back to the last executed command if cmd
doesn't exist.
Executes the command once if n
isn't defined either.
Deletes various privacy-related items.
The list of possible arguments can be found here: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/browsingData/DataTypeSet
Additional, tridactyl-specific arguments are:
Timespan parameter: -t [0-9]+(m|h|d|w)
Examples:
sanitise all
-> Deletes everything
sanitise history
-> Deletes all history
sanitise commandline tridactyllocal tridactylsync
-> Deletes every bit of data Tridactyl holds
sanitise cookies -t 3d
-> Deletes cookies that were set during the last three days.
If two numbers are given, treat as x and y values to give to window.scrollTo If one number is given, scroll to that percentage along a chosen axis, defaulting to the y-axis
Set a search engine keyword for use with *open or set searchengine
the keyword to use for this search (e.g. 'esa')
the URL to interpolate the query into. If %s is found in the URL, the query is inserted there, else it is appended. If the insertion point is in the "query string" of the URL, the query is percent-encoded, else it is verbatim.
Set a key value pair in config.
Use to set any string values found here
e.g. set searchurls.google https://www.google.com/search?q= set logging.messaging info
Close a tab.
Known bug: autocompletion will make it impossible to close more than one tab at once if the list of numbers looks enough like an open tab's title or URL.
The 1-based indexes of the tabs to target. indexes < 1 wrap. If omitted, this tab.
Detach a tab, opening it in a new window.
The 1-based index of the tab to target. index < 1 wraps. If omitted, this tab.
Duplicate a tab.
The 1-based index of the tab to target. index < 1 wraps. If omitted, this tab.
Switch to the first tab.
Switch to the last tab.
Move the current tab to be just in front of the index specified.
Known bug: This supports relative movement, but autocomple doesn't know that yet and will override positive and negative indexes.
Put a space in front of tabmove if you want to disable completion and have the relative indexes at the command line.
Binds are unaffected.
New index for the current tab.
1 is the first index. 0 is the last index. -1 is the penultimate, etc.
Switch to the next tab, wrapping round.
If increment is specified, move that many tabs forwards.
Switch to the next tab, wrapping round.
If an index is specified, go to the tab with that number (this mimics the
behaviour of {count}gt
in vim, except that this command will accept a
count that is out of bounds (and will mod it so that it is within bounds as
per tabmove, etc)).
Close all other tabs in this window
Like open, but in a new tab. If no address is given, it will open the newtab page, which can be set with set newtab [url]
Unlike Firefox's Ctrl-t shortcut, this opens tabs immediately after the currently active tab rather than at the end of the tab list because that is the author's preference.
If you would rather the Firefox behaviour set tabopenpos last
. This
preference also affects the clipboard, quickmarks, home, help, etc.
If you would rather the URL be opened as if you'd middle clicked it, set
tabopenpos related
.
Hinting is controlled by relatedopenlast
Switch to the previous tab, wrapping round.
If increment is specified, move that many tabs backwards.
Equivalent to fillcmdline buffer
Sort of Vimperator alias
Read text content of elements matching the given selector
the selector to match elements
Cancel current reading and clear pending queue
Arguments:
Read the given text using the browser's text to speech functionality and the settings currently set
the command mode -t read the following args as text -c read the content of elements matching the selector
Show a list of the voices available to the TTS system. These can be
set in the config using ttsvoice
Start the tutorial
whether to start the tutorial in a newtab. Defaults to current tab.
restore most recently closed tab in this window unless the most recently closed item was a window
Blur (unfocus) the active element
Increment the current tab URL
the increment step, can be positive or negative
Open a URL made by modifying the current URL
There are several modes:
Text replace mode: urlmodify -t <old> <new>
Replaces the first instance of the text old
with new
.
http://example.com
-> (-t exa peta
) -> http://petample.com
Regex replacment mode: urlmodify -r <regexp> <new> [flags]
Replaces the first match of the regexp
with new
. You can use
flags i
and g
to match case-insensitively and to match
all instances respectively
http://example.com
-> (-r [ea] X g
) -> http://XxXmplX.com
Query replace mode: urlmodify -q <query> <new_val>
Replace the value of a query with a new one:
http://e.com?id=foo
-> (-q id bar
) -> `http://e.com?id=barQuery delete mode: urlmodify -Q <query>
Deletes the given query (and the value if any):
http://e.com?id=foo&page=1
-> (-Q id
) -> http://e.com?page=1
Graft mode: urlmodify -g <graft_point> <new_path_tail>
"Grafts" a new tail on the URL path, possibly removing some of the old tail. Graft point indicates where the old URL is truncated before adding the new path.
graft_point
>= 0 counts path levels, starting from the left
(beginning). 0 will append from the "root", and no existing path will
remain, 1 will keep one path level, and so on.graft_point
< 0 counts from the right (i.e. the end of the current
path). -1 will append to the existing path, -2 will remove the last path
level, and so on.http://website.com/this/is/the/path/component
Graft point: ^ ^ ^ ^ ^ ^
From left: 0 1 2 3 4 5
From right: -6 -5 -4 -3 -2 -1
Examples:
http://e.com/issues/42
-> (-g 0 foo
) -> http://e.com/foo
http://e.com/issues/42
-> (-g 1 foo
) -> http://e.com/issues/foo
http://e.com/issues/42
-> (-g -1 foo
) -> http://e.com/issues/42/foo
http://e.com/issues/42
-> (-g -2 foo
) -> http://e.com/issues/foo
The replace mode:
Go to the parent URL of the current tab's URL
Go to the root domain of the current URL
Like tabopen, but in a new window
Generated using TypeDoc
Tridactyl help page
Use
:help <excmd>
or scroll down to show help for a particular excmd.The default keybinds can be found here. You can also view them with bind. Try
bind j
.For more information, and FAQs, check out our readme on github.
Tridactyl is in a pretty early stage of development. Please report any issues and make requests for missing features on the GitHub project page. You can also get in touch using Matrix, Gitter, or IRC chat clients:
All three channels are mirrored together, so it doesn't matter which one you use.
How to use this help page
We've hackily re-purposed TypeDoc which is designed for internal documentation. Every function (excmd) on this page can be called via Tridactyl's command line which we call "ex". There is a slight change in syntax, however. Wherever you see:
function(arg1,arg2)
You should instead type
function arg1 arg2
into the Tridactyl command line (accessed via:
)A "splat" operator (...) means that the excmd will accept any number of space-delimited arguments into that parameter.
You do not need to worry about types or return values.
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 which is nigh-on unreadable on these pages.
Highlighted features:
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 tabI
to enter ignore mode.Shift
+Escape
to return to normal mode.f
to start "hint mode",F
to open in backgroundo
to:open
a different pages
if you want to search for something that looks like a domain name or URL:bind J tabnext
:help
to see a list of available excmdsyy
to copy the current page URL to your clipboard]]
and[[
to navigate through the pages of comics, paginated articles, etcZZ
will 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"There are some caveats common to all webextension vimperator-alikes:
:open
as it will fail silentlyIf you want a more fully-featured vimperator-alike, your best option is Firefox ESR and Vimperator :)