mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 1167756 - Switch to openUILink for the Pocket menubar item to avoid using and leaking AppConstants. r=jaws
This commit is contained in:
parent
6154e9adac
commit
598d42d539
@ -400,7 +400,7 @@
|
||||
#ifndef XP_MACOSX
|
||||
class="menuitem-iconic"
|
||||
#endif
|
||||
oncommand="window.pktUI.openTabWithUrl(Pocket.listURL);"/>
|
||||
oncommand="openUILink(Pocket.listURL, event);"/>
|
||||
<menuseparator id="menu_pocketSeparator"/>
|
||||
<menuitem id="menu_bookmarkThisPage"
|
||||
command="Browser:AddBookmarkAs"
|
||||
|
@ -42,8 +42,6 @@
|
||||
// TODO : [nice to have] - Immediately save, buffer the actions in a local queue and send (so it works offline, works like our native extensions)
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",
|
||||
@ -624,12 +622,7 @@ var pktUI = (function() {
|
||||
function openTabWithUrl(url) {
|
||||
let recentWindow = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (!recentWindow) {
|
||||
if (this.AppConstants.platform == "macosx") {
|
||||
let hiddenWindow = Services.appShell.hiddenDOMWindow;
|
||||
// If there are no open browser windows, open a new one.
|
||||
hiddenWindow.openDialog("chrome://browser/content/", "_blank",
|
||||
"chrome,all,dialog=no", url);
|
||||
}
|
||||
Cu.reportError("Pocket: No open browser windows to openTabWithUrl");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user