|
@@ -0,0 +1,114 @@
|
|
|
+# HG changeset patch
|
|
|
+# User Frank-Rainer Grahl <frgrahl@gmx.net>
|
|
|
+# Date 1729014988 -7200
|
|
|
+# Parent 6090841a4d33cd38ebeba5c6a6888fe02d0d1812
|
|
|
+Bug 1911841 - To be added to 2.53 Bug 1476333 patch after brief testing. r=none a=none
|
|
|
+
|
|
|
+diff --git a/addon-sdk/source/lib/sdk/window/utils.js b/addon-sdk/source/lib/sdk/window/utils.js
|
|
|
+--- a/addon-sdk/source/lib/sdk/window/utils.js
|
|
|
++++ b/addon-sdk/source/lib/sdk/window/utils.js
|
|
|
+@@ -6,35 +6,36 @@
|
|
|
+ module.metadata = {
|
|
|
+ 'stability': 'unstable'
|
|
|
+ };
|
|
|
+
|
|
|
+ const { Cc, Ci } = require('chrome');
|
|
|
+ lazyRequireModule(this, "../util/array", "array");
|
|
|
+ const { defer } = require('sdk/core/promise');
|
|
|
+ const { dispatcher } = require("../util/dispatcher");
|
|
|
++const { AppConstants } = require("resource://gre/modules/AppConstants.jsm");
|
|
|
+
|
|
|
+ const windowWatcher = Cc['@mozilla.org/embedcomp/window-watcher;1'].
|
|
|
+ getService(Ci.nsIWindowWatcher);
|
|
|
+ const appShellService = Cc['@mozilla.org/appshell/appShellService;1'].
|
|
|
+ getService(Ci.nsIAppShellService);
|
|
|
+ const WM = Cc['@mozilla.org/appshell/window-mediator;1'].
|
|
|
+ getService(Ci.nsIWindowMediator);
|
|
|
+ const io = Cc['@mozilla.org/network/io-service;1'].
|
|
|
+ getService(Ci.nsIIOService);
|
|
|
+ const FM = Cc["@mozilla.org/focus-manager;1"].
|
|
|
+ getService(Ci.nsIFocusManager);
|
|
|
+
|
|
|
+ const XUL_NS = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul';
|
|
|
+
|
|
|
+ const prefs = require("../preferences/service");
|
|
|
+-const BROWSER = 'navigator:browser',
|
|
|
+- URI_BROWSER = prefs.get('browser.chromeURL', null),
|
|
|
+- NAME = '_blank',
|
|
|
+- FEATURES = 'chrome,all,dialog=no,non-private';
|
|
|
++const BROWSER = 'navigator:browser';
|
|
|
++const URI_BROWSER = AppConstants.BROWSER_CHROME_URL;
|
|
|
++const NAME = '_blank':
|
|
|
++const FEATURES = 'chrome,all,dialog=no,non-private';
|
|
|
+
|
|
|
+ function isWindowPrivate(win) {
|
|
|
+ if (!win)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ // if the pbService is undefined, the PrivateBrowsingUtils.jsm is available,
|
|
|
+ // and the app is Firefox, then assume per-window private browsing is
|
|
|
+ // enabled.
|
|
|
+diff --git a/toolkit/components/xulstore/tests/xpcshell/test_XULStore.js b/toolkit/components/xulstore/tests/xpcshell/test_XULStore.js
|
|
|
+--- a/toolkit/components/xulstore/tests/xpcshell/test_XULStore.js
|
|
|
++++ b/toolkit/components/xulstore/tests/xpcshell/test_XULStore.js
|
|
|
+@@ -1,19 +1,20 @@
|
|
|
+ /* Any copyright is dedicated to the Public Domain.
|
|
|
+ http://creativecommons.org/publicdomain/zero/1.0/◦
|
|
|
+ */
|
|
|
+
|
|
|
+ "use strict"
|
|
|
+
|
|
|
+ ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|
|
+-ChromeUtils.import("resource://gre/modules/osfile.jsm")
|
|
|
++ChromeUtils.import("resource://gre/modules/osfile.jsm");
|
|
|
++ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
|
|
+
|
|
|
+ var XULStore = null;
|
|
|
+-var browserURI = "chrome://browser/content/browser.xul";
|
|
|
++var browserURI = AppConstants.BROWSER_CHROME_URL;
|
|
|
+ var aboutURI = "about:config";
|
|
|
+
|
|
|
+ function run_test() {
|
|
|
+ do_get_profile();
|
|
|
+ run_next_test();
|
|
|
+ }
|
|
|
+
|
|
|
+ function checkValue(uri, id, attr, reference) {
|
|
|
+diff --git a/toolkit/mozapps/extensions/test/browser/browser_openDialog.js b/toolkit/mozapps/extensions/test/browser/browser_openDialog.js
|
|
|
+--- a/toolkit/mozapps/extensions/test/browser/browser_openDialog.js
|
|
|
++++ b/toolkit/mozapps/extensions/test/browser/browser_openDialog.js
|
|
|
+@@ -1,14 +1,15 @@
|
|
|
+ /* Any copyright is dedicated to the Public Domain.
|
|
|
+ * http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
+ */
|
|
|
+
|
|
|
+ // Tests the dialog open by the Options button for addons that provide a
|
|
|
+ // custom chrome-like protocol for optionsURL.
|
|
|
++ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
|
|
+
|
|
|
+ var CustomChromeProtocol = {
|
|
|
+ scheme: "khrome",
|
|
|
+ defaultPort: -1,
|
|
|
+ protocolFlags: Ci.nsIProtocolHandler.URI_DANGEROUS_TO_LOAD |
|
|
|
+ Ci.nsIProtocolHandler.URI_IS_LOCAL_RESOURCE |
|
|
|
+ Ci.nsIProtocolHandler.URI_NORELATIVE |
|
|
|
+ Ci.nsIProtocolHandler.URI_NOAUTH,
|
|
|
+@@ -121,17 +122,17 @@ function test() {
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case "domwindowopened":
|
|
|
+ let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
|
|
|
+ waitForFocus(function() {
|
|
|
+ // If the openDialog privileges are wrong a new browser window
|
|
|
+ // will open, let the test proceed (and fail) rather than timeout.
|
|
|
+ if (win.location != currentAddon.optionsURL &&
|
|
|
+- win.location != "chrome://browser/content/browser.xul")
|
|
|
++ win.location != AppConstants.BROWSER_CHROME_URL)
|
|
|
+ return;
|
|
|
+
|
|
|
+ is(win.location, currentAddon.optionsURL,
|
|
|
+ "The correct addon pref window should have opened");
|
|
|
+
|
|
|
+ let chromeFlags = win.QueryInterface(Ci.nsIInterfaceRequestor).
|
|
|
+ getInterface(Ci.nsIWebNavigation).
|
|
|
+ QueryInterface(Ci.nsIDocShellTreeItem).treeOwner.
|