mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 14:47:31 +09:00
Issue #1082 - Restore a getBoolPref global shim in utilityOverlay.js for Extension compatibility
This commit is contained in:
parent
cf0a5a54cd
commit
c14d99f0ed
2 changed files with 21 additions and 0 deletions
|
|
@ -17,6 +17,9 @@ XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
|
||||||
"@mozilla.org/browser/aboutnewtab-service;1",
|
"@mozilla.org/browser/aboutnewtab-service;1",
|
||||||
"nsIAboutNewTabService");
|
"nsIAboutNewTabService");
|
||||||
|
|
||||||
|
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
|
||||||
|
"resource://gre/modules/Deprecated.jsm");
|
||||||
|
|
||||||
this.__defineGetter__("BROWSER_NEW_TAB_URL", () => {
|
this.__defineGetter__("BROWSER_NEW_TAB_URL", () => {
|
||||||
if (PrivateBrowsingUtils.isWindowPrivate(window) &&
|
if (PrivateBrowsingUtils.isWindowPrivate(window) &&
|
||||||
!PrivateBrowsingUtils.permanentPrivateBrowsing &&
|
!PrivateBrowsingUtils.permanentPrivateBrowsing &&
|
||||||
|
|
@ -42,6 +45,13 @@ function getBrowserURL()
|
||||||
return "chrome://browser/content/browser.xul";
|
return "chrome://browser/content/browser.xul";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getBoolPref(pref, defaultValue) {
|
||||||
|
Deprecated.warning("getBoolPref is deprecated and will be removed in a future release. " +
|
||||||
|
"You should use Services.pref.getBoolPref (Services.jsm).",
|
||||||
|
"https://github.com/MoonchildProductions/UXP/issues/989");
|
||||||
|
return Services.prefs.getBoolPref(pref, defaultValue);
|
||||||
|
}
|
||||||
|
|
||||||
function getTopWin(skipPopups) {
|
function getTopWin(skipPopups) {
|
||||||
// If this is called in a browser window, use that window regardless of
|
// If this is called in a browser window, use that window regardless of
|
||||||
// whether it's the frontmost window, since commands can be executed in
|
// whether it's the frontmost window, since commands can be executed in
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@ Components.utils.import("resource:///modules/RecentWindow.jsm");
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, "ShellService",
|
XPCOMUtils.defineLazyModuleGetter(this, "ShellService",
|
||||||
"resource:///modules/ShellService.jsm");
|
"resource:///modules/ShellService.jsm");
|
||||||
|
|
||||||
|
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
|
||||||
|
"resource://gre/modules/Deprecated.jsm");
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(this, "BROWSER_NEW_TAB_URL", function () {
|
XPCOMUtils.defineLazyGetter(this, "BROWSER_NEW_TAB_URL", function () {
|
||||||
const PREF = "browser.newtab.url";
|
const PREF = "browser.newtab.url";
|
||||||
|
|
||||||
|
|
@ -57,6 +60,14 @@ function getBrowserURL()
|
||||||
return "chrome://browser/content/browser.xul";
|
return "chrome://browser/content/browser.xul";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getBoolPref(pref, defaultValue) {
|
||||||
|
Deprecated.warning("getBoolPref is deprecated and will be removed in a future release. " +
|
||||||
|
"You should use Services.pref.getBoolPref (Services.jsm).",
|
||||||
|
"https://github.com/MoonchildProductions/UXP/issues/989");
|
||||||
|
return Services.prefs.getBoolPref(pref, defaultValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function getTopWin(skipPopups) {
|
function getTopWin(skipPopups) {
|
||||||
// If this is called in a browser window, use that window regardless of
|
// If this is called in a browser window, use that window regardless of
|
||||||
// whether it's the frontmost window, since commands can be executed in
|
// whether it's the frontmost window, since commands can be executed in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue