summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-02-13 09:23:25 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-02-13 09:23:25 +0100
commitcb959aec3a5c62de58067d5e2fe7333e1aac4d1e (patch)
tree16d761f2ad4166c037096845e833ef0099741be2
parent71c81eb900ac3b8a770a4b844771faf335999861 (diff)
downloadUXP-cb959aec3a5c62de58067d5e2fe7333e1aac4d1e.tar
UXP-cb959aec3a5c62de58067d5e2fe7333e1aac4d1e.tar.gz
UXP-cb959aec3a5c62de58067d5e2fe7333e1aac4d1e.tar.lz
UXP-cb959aec3a5c62de58067d5e2fe7333e1aac4d1e.tar.xz
UXP-cb959aec3a5c62de58067d5e2fe7333e1aac4d1e.zip
Treat aContext as a bitfield in openURI.
Potential fix for #971
-rw-r--r--application/palemoon/base/content/browser.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js
index eb4916e37..3feeef9b6 100644
--- a/application/palemoon/base/content/browser.js
+++ b/application/palemoon/base/content/browser.js
@@ -4408,7 +4408,13 @@ nsBrowserAccess.prototype = {
openURI: function (aURI, aOpener, aWhere, aContext) {
var newWindow = null;
- var isExternal = (aContext == Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
+ var isExternal = !!(aContext & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
+
+ if (aOpener && isExternal) {
+ Cu.reportError("nsBrowserAccess.openURI did not expect an opener to be " +
+ "passed if the context is OPEN_EXTERNAL.");
+ throw Cr.NS_ERROR_FAILURE;
+ }
if (isExternal && aURI && aURI.schemeIs("chrome")) {
dump("use -chrome command-line option to load external chrome urls\n");