Generated from excmds.ts. Don't edit this file!

Index

Functions

back

  • back(n?: number): void
  • Navigate back one page in history.

    Parameters

    • Default value n: number = 1

    Returns void

fillinput

  • fillinput(selector: string, ...content: string[]): Promise<void>
  • Fills the element matched by selector with content and falls back to the last used input if the element can't be found. You probably don't want this; it's used internally for editor.

    That said, bind gs fillinput null [Tridactyl](https://addons.mozilla.org/en-US/firefox/addon/tridactyl-vim/) is my favourite add-on could probably come in handy.

    Parameters

    • selector: string
    • Rest ...content: string[]

    Returns Promise<void>

focusinput

  • focusinput(nth: number | string): void
  • Focus the last used input on the page

    Parameters

    • nth: number | string

      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

    Returns void

followpage

  • followpage(rel?: "next" | "prev"): void
  • 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|»|>>
    

    Parameters

    • Default value rel: "next" | "prev" = "next"

      the relation of the target page to the current page: "next" or "prev"

    Returns void

forward

  • forward(n?: number): void
  • Navigate forward one page in history.

    Parameters

    • Default value n: number = 1

    Returns void

hint

  • hint(option?: string, selectors?: string, ...rest: string[]): Promise<Object>
  • Hint a page.

    Parameters

    • Optional option: string
      • -b open in background
      • -br repeatedly open in background
      • -y copy (yank) link's target to clipboard
      • -p copy an element's text to the clipboard
      • -P copy an element's title/alt text to the clipboard
      • -r read an element's text with text-to-speech
      • -i view an image
      • -I view an image in a new tab
      • -k delete an element from the page
      • -s save (download) the linked resource
      • -S save the linked image
      • -a save-as the linked resource
      • -A save-as the linked image
      • -; focus an element
      • -# yank an element's anchor URL to clipboard
      • -c [selector] hint links that match the css selector
      • bind ;c hint -c [class*="expand"],[class="togg"] works particularly well on reddit and HN
      • -w open in new window -wp open in new private window
      • -pipe selector key e.g, -pipe * href returns the key. Only makes sense with composite, e.g, composite hint -pipe * textContent | yank.
      • DEPRECATED -W excmd... append hint href to excmd and execute, e.g, hint -W exclaim mpv to open YouTube videos. Use composite hint -pipe | [excmd] instead.

      Excepting 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"
      • "hintuppercase": "true" | "false"
      • "hintnames": "short" | "uniform" | "numeric"

      With "short" names, Tridactyl will generate short hints that are never prefixes of each other. With "uniform", Tridactyl will generate hints of uniform length. In either case, the hints are generated from the set in "hintchars".

      With "numeric" names, hints are always assigned using sequential integers, and "hintchars" is ignored. This has the disadvantage that some hints are prefixes of others (and you need to hit space or enter to select such a hint). But it has the advantage that the hints tend to be more predictable (e.g., a news site will have the same hints for its boilerplate each time you visit it, even if the number of links in the main body changes).

    • Optional selectors: string
    • Rest ...rest: string[]

    Returns Promise<Object>

js

  • js(...str: string[]): Promise<any>
  • Lets you execute JavaScript in the page context. If you want to get the result back, use composite js ... | fillcmdline

    Some of Tridactyl's functions are accessible here via the tri object. Just do console.log(tri) in the web console on the new tab page to see what's available.

    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)

    Parameters

    • Rest ...str: string[]

    Returns Promise<any>

jumpnext

  • jumpnext(n?: number): void
  • Calls jumpprev(-n)

    Parameters

    • Default value n: number = 1

    Returns void

jumpprev

  • jumpprev(n?: number): void
  • Similar to Pentadactyl or vim's jump list.

    Parameters

    • Default value n: number = 1

    Returns void

open

  • open(...urlarr: string[]): Promise<void>
  • Open a new page in the current tab.

    @param urlarr

      - if first word looks like it has a schema, treat as a URI
      - else if the first word contains a dot, treat as a domain name
      - else if the first word is a key of [[SEARCH_URLS]], treat all following terms as search parameters for that provider
      - else treat as search parameters for google
    

    Related settings:

     - "searchengine": "google" or any of [[SEARCH_URLS]]
     - "historyresults": the n-most-recent results to ask Firefox for before they are sorted by frequency. Reduce this number if you find your results are bad.
    

    Can only open about: or file: URLs if you have the native messenger installed, and on OSX you must set browser to something that will open Firefox from a terminal pass it commmand line options.

    Parameters

    • Rest ...urlarr: string[]

    Returns Promise<void>

open_quiet

  • open_quiet(...urlarr: string[]): Promise<void>
  • Like open but doesn't make a new entry in history.

    Parameters

    • Rest ...urlarr: string[]

    Returns Promise<void>

scrollline

  • scrollline(n?: number): void
  • Scrolls the document of its first scrollable child element by n lines.

    The height of a line is defined by the site's CSS. If Tridactyl can't get it, it'll default to 22 pixels.

    Parameters

    • Default value n: number = 1

    Returns void

scrollpage

  • scrollpage(n?: number): void
  • Scrolls the document by n pages.

    The height of a page is the current height of the window.

    Parameters

    • Default value n: number = 1

    Returns void

scrollpx

  • scrollpx(a: number, b: number): Promise<void>
  • Scrolls the window or any scrollable child element by a pixels on the horizontal axis and b pixels on the vertical axis.

    Parameters

    • a: number
    • b: number

    Returns Promise<void>

scrollto

  • scrollto(a: number, b?: number | "x" | "y"): void
  • 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

    Note that if a is 0 or 100 and if the document is not scrollable in the given direction, Tridactyl will attempt to scroll the first scrollable element until it reaches the very bottom of that element.

    Parameters

    • a: number
    • Default value b: number | "x" | "y" = "y"

    Returns void

tssReadFromCss

  • tssReadFromCss(selector: string): void
  • Read text content of elements matching the given selector

    Parameters

    • selector: string

      the selector to match elements

    Returns void

ttscontrol

  • ttscontrol(action: string): Promise<void>
  • Cancel current reading and clear pending queue

    Arguments:

    • stop: cancel current and pending utterances

    Parameters

    • action: string

    Returns Promise<void>

ttsread

  • ttsread(mode: "-t" | "-c", ...args: string[]): Promise<void>
  • Read the given text using the browser's text to speech functionality and the settings currently set

    Parameters

    • mode: "-t" | "-c"

      the command mode -t read the following args as text -c read the content of elements matching the selector

    • Rest ...args: string[]

    Returns Promise<void>

unfocus

  • unfocus(): void
  • Blur (unfocus) the active element

    Returns void

url2args

  • url2args(): Promise<string>
  • If the url of the current document matches one of your search engines, will convert it to a list of arguments that open/tabopen will understand. If the url doesn't match any search engine, returns the url without modifications.

    For example, if you have searchurls.gi set to "https://www.google.com/search?q=%s&tbm=isch", using this function on a page you opened using "gi butterflies" will return "gi butterflies".

    This is useful when combined with fillcmdline, for example like this: bind O composite url2args | fillcmdline open.

    Note that this might break with search engines that redirect you to other pages/add GET parameters that do not exist in your searchurl.

    Returns Promise<string>

urlincrement

  • urlincrement(count?: number): void
  • Increment the current tab URL

    Parameters

    • Default value count: number = 1

      the increment step, can be positive or negative

    Returns void

urlmodify

  • urlmodify(mode: "-t" | "-r" | "-q" | "-Q" | "-g", ...args: string[]): void
  • 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:

    • Query 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

    Parameters

    • mode: "-t" | "-r" | "-q" | "-Q" | "-g"

      The replace mode:

      • -t text replace
      • -r regexp replace
      • -q replace the value of the given query
      • -Q delete the given query
      • -g graft a new path onto URL or parent path of it
    • Rest ...args: string[]

    Returns void

urlparent

  • urlparent(count?: number): void
  • Go to the parent URL of the current tab's URL

    Parameters

    • Default value count: number = 1

    Returns void

urlroot

  • urlroot(): void
  • Go to the root domain of the current URL

    Returns void

viewconfig

  • viewconfig(key?: string): void
  • Opens the current configuration in Firefox's native JSON viewer in the current tab.

    NB: Tridactyl cannot run on this page!

    Parameters

    • Optional key: string

      The specific key you wish to view (e.g, nmaps).

    Returns void

viewcontainers

  • viewcontainers(): Promise<void>
  • Shows a list of the current containers in Firefox's native JSON viewer in the current tab.

    NB: Tridactyl cannot run on this page!

    Returns Promise<void>

viewsource

  • viewsource(url?: string): void
  • Display the (HTML) source of the current page.

    Behaviour can be changed by the 'viewsource' setting.

    If the 'viewsource' setting is set to 'default' rather than 'tridactyl', the url the source of which should be displayed can be given as argument. Otherwise, the source of the current document will be displayed.

    Parameters

    • Default value url: string = ""

    Returns void