From be119b3d4e82923bb02620aa48555f96be4726d5 Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Fri, 14 Jun 2019 11:16:06 +0100 Subject: [PATCH] Make ;v safer --- src/excmds.ts | 2 +- src/lib/config.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/excmds.ts b/src/excmds.ts index a600b1e3..b68b557f 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -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 ), 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 , 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 diff --git a/src/lib/config.ts b/src/lib/config.ts index bcaa876a..625fc485 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -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))", } /**