MCPcopy
hub / github.com/philc/vimium / constructor

Method constructor

content_scripts/link_hints.js:1497–1514  ·  view source on GitHub ↗
(delay, callback)

Source from the content-addressed store, hash-verified

1495// Suppress all keyboard events until the user stops typing for sufficiently long.
1496class TypingProtector extends Mode {
1497 constructor(delay, callback) {
1498 super();
1499 this.init({
1500 name: "hint/typing-protector",
1501 suppressAllKeyboardEvents: true,
1502 keydown: resetExitTimer,
1503 keypress: resetExitTimer,
1504 });
1505
1506 this.timer = Utils.setTimeout(delay, () => this.exit());
1507
1508 const resetExitTimer = () => {
1509 clearTimeout(this.timer);
1510 this.timer = Utils.setTimeout(delay, () => this.exit());
1511 };
1512
1513 this.onExit(() => callback(true)); // true -> isSuccess.
1514 }
1515}
1516
1517class WaitForEnter extends Mode {

Callers

nothing calls this directly

Calls 3

onExitMethod · 0.80
initMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected