noscript icon indicating copy to clipboard operation
noscript copied to clipboard

toggleEnforcementForTab opens a context menu instead of toggling enforcement

Open saidelike opened this issue 2 years ago • 3 comments

Firefox: 110.0 OS: Windows 10 NoScript: 11.4.16

This issue is related to https://github.com/hackademix/noscript/issues/94 and https://github.com/hackademix/noscript/issues/129 but I created a new issue as I have a different behaviour.

When I try to use the Alt+Shift+Space shortcut from https://github.com/hackademix/noscript/blob/main/src/manifest.json#L150

    "toggleEnforcementForTab": {
      "description": "__MSG_toggleEnforcementForTab__",
      "suggested_key": {
        "default": "Alt+Shift+Space"
      }

related to code in https://github.com/hackademix/noscript/blob/main/src/bg/main.js#L99

    async toggleEnforcementForTab() {
      let [tab] = (await browser.tabs.query({
        currentWindow: true,
        active: true
      }));
      if (tab) {
        let toggle = ns.unrestrictedTabs.has(tab.id) ? "delete" : "add";
        ns.unrestrictedTabs[toggle](tab.id);
        browser.tabs.reload(tab.id);
      }
    },

It opens this context menu on the top right corner instead of toggling enforcement:

image

saidelike avatar Feb 22 '23 17:02 saidelike

NOTE: if anyone is interested, you can change the default shortcuts using https://support.mozilla.org/en-US/kb/manage-extension-shortcuts-firefox

saidelike avatar Feb 22 '23 17:02 saidelike

So this seems Windows specific. Could you suggest an alternate non conflicting shortcut for that OS? Thank you!

hackademix avatar Feb 22 '23 18:02 hackademix

Please check 11.4.17rc1, thanks.

hackademix avatar Feb 22 '23 22:02 hackademix