12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- # HG changeset patch
- # User Bill Gianopoulos <wgianopoulos@gmail.com>
- # Date 1623804470 0
- # Parent 5baac9de16364064c2579f094bd64c65f13a7931
- Bug 9999999 - Port Bug 1646560 - Move allowJavascript and friends from DocShell to BrowsingContext and WindowContext.
- diff --git a/suite/base/content/nsContextMenu.js b/suite/base/content/nsContextMenu.js
- --- a/suite/base/content/nsContextMenu.js
- +++ b/suite/base/content/nsContextMenu.js
- @@ -56,17 +56,17 @@ nsContextMenu.prototype = {
- // Get contextual info.
- this.setTarget(document.popupNode, document.popupRangeParent,
- document.popupRangeOffset);
-
- if (!this.shouldDisplay)
- return;
-
- this.hasPageMenu = false;
- - if (!aIsShift && this.browser.docShell.allowJavascript &&
- + if (!aIsShift && this.browser.browsingContext.allowJavascript &&
- Services.prefs.getBoolPref("javascript.enabled"))
- this.hasPageMenu = PageMenuParent.buildAndAddToPopup(this.target, aXulMenu);
-
- this.isTextSelected = this.isTextSelection();
- this.isContentSelected = this.isContentSelection();
-
- // Initialize gContextMenuContentData.
- if (aEvent)
- diff --git a/suite/components/helpviewer/content/help.js b/suite/components/helpviewer/content/help.js
- --- a/suite/components/helpviewer/content/help.js
- +++ b/suite/components/helpviewer/content/help.js
- @@ -110,17 +110,17 @@ function init() {
- // Cache panel references.
- helpSearchPanel = document.getElementById("help-search-panel");
- helpTocPanel = document.getElementById("help-toc-panel");
- helpIndexPanel = document.getElementById("help-index-panel");
- helpGlossaryPanel = document.getElementById("help-glossary-panel");
- helpBrowser = document.getElementById("help-content");
-
- // Turn off unnecessary features for security
- - helpBrowser.docShell.allowJavascript = false;
- + helpBrowser.browsingContext.allowJavascript = false;
- helpBrowser.docShell.allowPlugins = false;
- helpBrowser.docShell.allowSubframes = false;
- helpBrowser.docShell.allowMetaRedirects = false;
-
- strBundle = document.getElementById("bundle_help");
- emptySearchText = strBundle.getString("emptySearchText");
-
- // Get the content pack, base URL, and help topic
- diff --git a/suite/components/sessionstore/nsSessionStore.js b/suite/components/sessionstore/nsSessionStore.js
- --- a/suite/components/sessionstore/nsSessionStore.js
- +++ b/suite/components/sessionstore/nsSessionStore.js
- @@ -65,17 +65,17 @@ const WINDOW_HIDEABLE_FEATURES = [
- docShell capabilities to (re)store
- Restored in restoreHistory()
- eg: browser.docShell["allow" + aCapability] = false;
-
- XXX keep these in sync with all the attributes starting
- with "allow" in /docshell/base/nsIDocShell.idl
- */
- const CAPABILITIES = [
- - "Subframes", "Plugins", "Javascript", "MetaRedirects", "Images",
- + "Subframes", "Plugins", "MetaRedirects", "Images",
- "DNSPrefetch", "Auth", "WindowControl"
- ];
-
- // These are tab events that we listen to.
- const TAB_EVENTS = ["TabOpen", "TabClose", "TabSelect", "TabShow", "TabHide"];
-
- var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
- var {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
- diff --git a/suite/components/tests/browser/browser_493467.js b/suite/components/tests/browser/browser_493467.js
- --- a/suite/components/tests/browser/browser_493467.js
- +++ b/suite/components/tests/browser/browser_493467.js
- @@ -18,17 +18,17 @@ function test() {
- is(browserWindowsCount(), 1, "Only one browser window should be open initially");
-
- let tab = getBrowser().addTab();
- tab.linkedBrowser.stop();
- let tabState = JSON.parse(ss.getTabState(tab));
- is(tabState.disallow || "", "", "Everything is allowed per default");
-
- // collect all permissions that can be set on a docShell (i.e. all
- - // attributes starting with "allow" such as "allowJavascript") and
- + // attributes starting with "allow" such as "allowImages") and
- // disallow them all, as SessionStore only remembers disallowed ones
- let permissions = [];
- let docShell = tab.linkedBrowser.docShell;
- for (let attribute in docShell) {
- if (/^allow([A-Z].*)/.test(attribute)) {
- permissions.push(RegExp.$1);
- docShell[attribute] = false;
- }
|