зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1833276 - Fix triggering screenshot component from quickaction. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D178128
This commit is contained in:
Родитель
83e9da4e05
Коммит
74c8097a09
|
@ -30,6 +30,13 @@ if (AppConstants.MOZ_UPDATER) {
|
|||
);
|
||||
}
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
lazy,
|
||||
"SCREENSHOT_BROWSER_COMPONENT",
|
||||
"screenshots.browser.component.enabled",
|
||||
false
|
||||
);
|
||||
|
||||
let openUrlFun = url => () => openUrl(url);
|
||||
let openUrl = url => {
|
||||
let window = lazy.BrowserWindowTracker.getTopWindow();
|
||||
|
@ -180,11 +187,19 @@ const DEFAULT_ACTIONS = {
|
|||
return !lazy.BrowserWindowTracker.getTopWindow().gScreenshots.shouldScreenshotsButtonBeDisabled();
|
||||
},
|
||||
onPick: () => {
|
||||
Services.obs.notifyObservers(
|
||||
lazy.BrowserWindowTracker.getTopWindow(),
|
||||
"menuitem-screenshot",
|
||||
"quick_actions"
|
||||
);
|
||||
if (lazy.SCREENSHOT_BROWSER_COMPONENT) {
|
||||
Services.obs.notifyObservers(
|
||||
lazy.BrowserWindowTracker.getTopWindow(),
|
||||
"menuitem-screenshot",
|
||||
"quick_actions"
|
||||
);
|
||||
} else {
|
||||
Services.obs.notifyObservers(
|
||||
null,
|
||||
"menuitem-screenshot-extension",
|
||||
"quickaction"
|
||||
);
|
||||
}
|
||||
return { focusContent: true };
|
||||
},
|
||||
},
|
||||
|
|
|
@ -70,7 +70,7 @@ this.startBackground = (function() {
|
|||
zoomFactor = await browser.tabs.getZoom(tab.id);
|
||||
if (type === "contextMenu") {
|
||||
main.onClickedContextMenu(tab);
|
||||
} else if (type === "toolbar") {
|
||||
} else if (type === "toolbar" || type === "quickaction") {
|
||||
main.onClicked(tab);
|
||||
} else if (type === "shortcut") {
|
||||
main.onShortcut(tab);
|
||||
|
|
Загрузка…
Ссылка в новой задаче