Commit 6fede10f authored by Emma Malysz's avatar Emma Malysz
Browse files

Bug 1725430: disable screenshot shortcut for extension when...

Bug 1725430: disable screenshot shortcut for extension when screenshots.browser.component.enabled is true. r=emalysz,fluent-reviewers,flod

Differential Revision: https://phabricator.services.mozilla.com/D125850
parent 6c11c9c2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -91,6 +91,8 @@
    <command id="Tools:Sanitize" oncommand="Sanitizer.showUI(window);"/>
    <command id="Tools:PrivateBrowsing"
      oncommand="OpenBrowserWindow({private: true});"/>
    <command id="Browser:Screenshot" oncommand="ScreenshotsUtils.notify(window, 'shortcut')"/>
    
#ifdef NIGHTLY_BUILD
    <command id="Tools:FissionWindow"
      oncommand="OpenBrowserWindow({fission: true, private: !!window?.browsingContext?.usePrivateBrowsing});"
@@ -303,6 +305,7 @@

    <key id="key_privatebrowsing" command="Tools:PrivateBrowsing" data-l10n-id="private-browsing-shortcut"
         modifiers="accel,shift" reserved="true"/>
    <key id="key_screenshot" data-l10n-id="screenshot-shortcut" command="Browser:Screenshot" modifiers="accel,shift"/>
    <key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
#ifdef XP_MACOSX
    <key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
  SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
  Sanitizer: "resource:///modules/Sanitizer.jsm",
  SaveToPocket: "chrome://pocket/content/SaveToPocket.jsm",
  ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.jsm",
  SessionStartup: "resource:///modules/sessionstore/SessionStartup.jsm",
  SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
  ShortcutUtils: "resource://gre/modules/ShortcutUtils.jsm",
+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@
  <link rel="localization" href="browser/tabbrowser.ftl"/>
  <link rel="localization" href="preview/firefoxSuggest.ftl"/>
  <link rel="localization" href="browser/toolbarContextMenu.ftl"/>
  <link rel="localization" href="browser/screenshots.ftl"/>

  <title data-l10n-id="browser-main-window-title"></title>

+5 −1
Original line number Diff line number Diff line
@@ -1300,7 +1300,11 @@ class nsContextMenu {
    if (SCREENSHOT_BROWSER_COMPONENT) {
      Services.obs.notifyObservers(window, "menuitem-screenshot", true);
    } else {
      Services.obs.notifyObservers(null, "menuitem-screenshot-extension", true);
      Services.obs.notifyObservers(
        null,
        "menuitem-screenshot-extension",
        "contextMenu"
      );
    }
  }

+6 −1
Original line number Diff line number Diff line
@@ -525,6 +525,7 @@ if (Services.prefs.getBoolPref("identity.fxaccounts.enabled")) {
if (!screenshotsDisabled) {
  CustomizableWidgets.push({
    id: "screenshot-button",
    shortcutId: "key_screenshot",
    l10nId: "screenshot-toolbarbutton",
    onCommand(aEvent) {
      if (SCREENSHOT_BROWSER_COMPONENT) {
@@ -533,7 +534,11 @@ if (!screenshotsDisabled) {
          "menuitem-screenshot"
        );
      } else {
        Services.obs.notifyObservers(null, "menuitem-screenshot-extension");
        Services.obs.notifyObservers(
          null,
          "menuitem-screenshot-extension",
          "toolbar"
        );
      }
    },
    onCreated(aNode) {
Loading