Hint mode functions

This file contains functions to interact with hint mode.

If you want to bind them to keyboard shortcuts, be sure to prefix them with "hint.". For example, if you want to bind control-[ to reset, use:

bind --mode=hint <C-[> hint.reset

Contrary to the main tridactyl help page, this one doesn't tell you whether a specific function is bound to something. For now, you'll have to make do with :bind and :viewconfig.

vimpHelper
hintElements
vimpHelper: object = ...

Helper for vimperator hinting.

Allow customize vimperator hinting filter by overriding functions of the helper object.

filterableTextFilter: null
matchHint: (str: any, key: any) => any = ...
sanitiseHintText: (str: any) => any = ...
  • A convenient javascript interface to hint on specified html elements. The return value is a promise resolving to the selected element, or an AsyncIterator resolving to the selected elements in rapid mode.

    Example usage:

    tri.hinting_content.hintElements(...).then(element => {tri.dom.simulateClick(element))

    for (await e of tri.hinting_content.hintElements(..., {rapid: true}){tri.dom.simulateClick(e)})

    Parameters

    • elements: Element[]

      a iterator yield html elements

    • option: {} = {}

      a option object. The option.rapid specify whether hint in rapid mode. Default value is false. The option.callback is executed when a hint is selected if specified. The default callback is a no-op.

    Returns Promise<unknown> | AsyncGenerator<any, any, unknown>

    promise resolve to the selected element, or a async iterator in rapid mode.