Much of the power of &dactyl.appName; lies in its scriptable expression evaluation. &dactyl.appName; understands two kinds of expressions: Ex commands, and JavaScript. Ex commands are simple, easy to type, and readily accessible from the &tag.command-line;. They form a core part of the user interface. JavaScript, on the other hand, is much less straightforward, but allows for any number of complex actions to be executed, with full access to all of the internals of &dactyl.appName; and &dactyl.host;. Both expression evaluation methods support sophisticated expression completion, including option lists and descriptions thereof, along with parentheses matching and syntax error highlighting.
Echo a JavaScript expression. expr may be a simple quoted string, in which case it is shown in the &tag.status-line;, or any arbitrary JavaScript expression. If the expression results in anything other than a string, it is pretty-printed in a multi-line frame just above the command line. The output depends on the type of object. Functions display their source, DOM nodes display the pretty-printed XML of the top-level node, XML literals are rendered as page content, and all other objects display their string representation and all of their enumerable properties.
See also
Echo the expression as an error message. Just like
Echo the expression as an informational message. Just like
Execute the Ex command string that results from the evaluation of the JavaScript expression expr. For example,
:execute open + content.location.host
opens the homepage of the currently opened site.
Evaluates the given cmd as JavaScript. Behaves exactly as
Moreover, multi-line scripts can be executed with shell-like here document syntax. For example, the following,
:javascript <<EOF
for each (var tab in tabs.visibleTabs)
tab.linkedBrowser.reload();
EOF
will reload all visible tabs.
Moreover, sophisticated, context-sensitive
Starts the JavaScript Read Eval Print Loop, where JavaScript statements are entered and evaluated, their results printed, and the input modified and entered again. Within the REPL, the results of a given evaluation are available as variables named for the given prompt.
If
js1> ({ foo : bar })[object Object] ::
foo : "bar" js2> js1.foobar
Sets or lists a variable. Sets the variable var-name to the value of the expression expr1. If no expression is given, the value of the variable is displayed. Without arguments, displays a list of all variables. This functionality has few useful applications and so is deprecated.
Deletes the named variables. When
Execute commands until the next
Ends a string of
Execute commands until the next
Execute commands until the next