Make ;v safer

This commit is contained in:
Oliver Blanthorn 2019-06-14 11:16:06 +01:00
parent 0f784d9607
commit be119b3d4e
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
2 changed files with 3 additions and 2 deletions

View file

@ -3640,7 +3640,7 @@ export function unset(...keys: string[]) {
- -wp open in new private window
- -z scroll an element to the top of the viewport
- `-pipe selector key` e.g, `-pipe a href` returns the key. Only makes sense with `composite`, e.g, `composite hint -pipe * textContent | yank`. If you don't select a hint (i.e. press <Esc>), will return an empty string.
- `-W excmd...` append hint href to excmd and execute, e.g, `hint -W exclaim mpv` to open YouTube videos.
- `-W excmd...` append hint href to excmd and execute, e.g, `hint -W mpvsafe` to open YouTube videos. NB: appending to bare [[exclaim]] is dangerous - see `get exaliases.mpvsafe` for an example of how to to it safely.
- -q* quick (or rapid) hints mode. Stay in hint mode until you press <Esc>, e.g. `:hint -qb` to open multiple hints in the background or `:hint -qW excmd` to execute excmd once for each hint. This will return an array containing all elements or the result of executed functions (e.g. `hint -qpipe a href` will return an array of links).
- -J* disable javascript hints. Don't generate hints related to javascript events. This is particularly useful when used with the `-c` option when you want to generate only hints for the specified css selectors. Also useful on sites with plenty of useless javascript elements such as google.com
- For example, use `bind ;jg hint -Jc .rc > .r > a` on google.com to generate hints only for clickable search results of a given query

View file

@ -249,7 +249,7 @@ export class default_config {
";A": "hint -A",
";;": "hint -;",
";#": "hint -#",
";v": "hint -W exclaim_quiet mpv",
";v": "hint -W mpvsafe",
";w": "hint -w",
";t": "hint -W tabopen",
";O": "hint -W fillcmdline_notrail open ",
@ -504,6 +504,7 @@ export class default_config {
mkt: "mktridactylrc",
"mkt!": "mktridactylrc -f",
"mktridactylrc!": "mktridactylrc -f",
mpvsafe: "js -p tri.excmds.shellescape(JS_ARG).then(url => tri.excmds.exclaim_quiet('mpv ' + url))",
}
/**