Quellcode durchsuchen

fix #2239: add a global toggle hotkey

tophf vor 11 Monaten
Ursprung
Commit
741311c4c1
3 geänderte Dateien mit 7 neuen und 0 gelöschten Zeilen
  1. 3 0
      src/_locales/en/messages.yml
  2. 2 0
      src/background/utils/icon.js
  3. 2 0
      src/manifest.yml

+ 3 - 0
src/_locales/en/messages.yml

@@ -1011,6 +1011,9 @@ titleSearchHintV2:
 
     * Regular expressions: <code>/\w+?/</code>, <code>/\w+?/gi</code>,
     <code>name:/\w+?/</code>, <code>name+re:"\w+? with space"</code>
+toggleInjection:
+  description: Label for a keyboard shortcut.
+  message: Toggle userscript injection
 trackEdits:
   description: Button in a script installation dialog.
   message: Track external edits

+ 2 - 0
src/background/utils/icon.js

@@ -245,6 +245,8 @@ export function handleHotkeyOrMenu(id, tab) {
     openDashboard('');
   } else if (id === 'newScript') {
     commands.OpenEditor();
+  } else if (id === 'toggleInjection') {
+    setOption(IS_APPLIED, !isApplied);
   } else if (id === 'updateScripts') {
     commands.CheckUpdate();
   } else if (id === 'updateScriptsInTab') {

+ 2 - 0
src/manifest.yml

@@ -42,6 +42,8 @@ permissions:
   - cookies
 commands:
   _execute_browser_action: {}
+  toggleInjection:
+    description: __MSG_toggleInjection__
   dashboard:
     description: __MSG_menuDashboard__
   settings: