MCPcopy Index your code
hub / github.com/philc/vimium / toggle

Function toggle

content_scripts/vimium_frontend.js:469–487  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

467 },
468
469 async toggle(request) {
470 // If we're in the help dialog page already and the user has typed a key to show the help
471 // dialog, then we should hide it.
472 if (globalThis.isVimiumHelpDialogPage) return HelpDialogPage.hide();
473
474 if (this.helpUI == null) {
475 await DomUtils.documentComplete();
476 this.helpUI = new UIComponent();
477 this.helpUI.load("pages/help_dialog_page.html", "vimium-help-dialog-frame");
478 }
479 if (this.isShowing()) {
480 this.helpUI.hide();
481 } else {
482 return this.helpUI.show(
483 { name: "show" },
484 { focus: true, sourceFrameId: request.sourceFrameId },
485 );
486 }
487 },
488};
489
490const testEnv = globalThis.window == null;

Callers

nothing calls this directly

Calls 3

loadMethod · 0.80
hideMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected