Bug 1489301 - Part 5: Expose all System-only objects on Window, r=bzbarsky
There is a limited number of these, and this allows me to completely remove
mention of the 'System' global.
In the future System-only exposure could be achieved using a [Func] enabler.
Differential Revision:
https://phabricator.services.mozilla.com/D9400
--- a/dom/chrome-webidl/ChannelWrapper.webidl
+++ b/dom/chrome-webidl/ChannelWrapper.webidl
@@ -36,17 +36,17 @@ enum MozContentPolicyType {
"speculative",
"other"
};
/**
* A thin wrapper around nsIChannel and nsIHttpChannel that allows JS
* callers to access them without XPConnect overhead.
*/
-[ChromeOnly, Exposed=System]
+[ChromeOnly, Exposed=Window]
interface ChannelWrapper : EventTarget {
/**
* Returns the wrapper instance for the given channel. The same wrapper is
* always returned for a given channel.
*/
static ChannelWrapper get(MozChannel channel);
/**
--- a/dom/chrome-webidl/MozDocumentObserver.webidl
+++ b/dom/chrome-webidl/MozDocumentObserver.webidl
@@ -4,14 +4,14 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
callback interface MozDocumentCallback {
void onNewDocument(MozDocumentMatcher matcher, WindowProxy window);
void onPreloadDocument(MozDocumentMatcher matcher, LoadInfo loadInfo);
};
-[ChromeOnly, Constructor(MozDocumentCallback callbacks), Exposed=System]
+[ChromeOnly, Constructor(MozDocumentCallback callbacks), Exposed=Window]
interface MozDocumentObserver {
[Throws]
void observe(sequence<MozDocumentMatcher> matchers);
void disconnect();
};
--- a/dom/chrome-webidl/WebExtensionContentScript.webidl
+++ b/dom/chrome-webidl/WebExtensionContentScript.webidl
@@ -4,17 +4,17 @@
interface LoadInfo;
interface URI;
interface WindowProxy;
typedef (MatchPatternSet or sequence<DOMString>) MatchPatternSetOrStringSequence;
typedef (MatchGlob or DOMString) MatchGlobOrString;
-[Constructor(MozDocumentMatcherInit options), ChromeOnly, Exposed=System]
+[Constructor(MozDocumentMatcherInit options), ChromeOnly, Exposed=Window]
interface MozDocumentMatcher {
/**
* Returns true if the script's match and exclude patterns match the given
* URI, without reference to attributes such as `allFrames`.
*/
boolean matchesURI(URI uri);
/**
@@ -127,17 +127,17 @@ enum ContentScriptRunAt {
/**
* The first point after the page and all of its resources has fully loaded
* when the event loop is idle, and can run scripts without delaying a paint
* event.
*/
"document_idle",
};
-[Constructor(WebExtensionPolicy extension, WebExtensionContentScriptInit options), ChromeOnly, Exposed=System]
+[Constructor(WebExtensionPolicy extension, WebExtensionContentScriptInit options), ChromeOnly, Exposed=Window]
interface WebExtensionContentScript : MozDocumentMatcher {
/**
* The earliest point in the load cycle at which this script should run. For
* static content scripts, in extensions which were present at browser
* startup, the browser makes every effort to make sure that the script runs
* no later than this point in the load cycle. For dynamic content scripts,
* and scripts from extensions installed during this session, the scripts
* may run at a later point.
--- a/dom/chrome-webidl/WebExtensionPolicy.webidl
+++ b/dom/chrome-webidl/WebExtensionPolicy.webidl
@@ -6,17 +6,17 @@ interface URI;
interface WindowProxy;
callback WebExtensionLocalizeCallback = DOMString (DOMString unlocalizedText);
/**
* Defines the platform-level policies for a WebExtension, including its
* permissions and the characteristics of its moz-extension: URLs.
*/
-[Constructor(WebExtensionInit options), ChromeOnly, Exposed=System]
+[Constructor(WebExtensionInit options), ChromeOnly, Exposed=Window]
interface WebExtensionPolicy {
/**
* The add-on's internal ID, as specified in its manifest.json file or its
* XPI signature.
*/
[Constant, StoreInSlot]
readonly attribute DOMString id;
--- a/dom/webidl/AddonManager.webidl
+++ b/dom/webidl/AddonManager.webidl
@@ -77,13 +77,13 @@ interface AddonManager : EventTarget {
* @return A promise that resolves to an instance of AddonInstall.
*/
Promise<AddonInstall> createInstall(optional addonInstallOptions options);
// Indicator to content whether permissions prompts are enabled
readonly attribute boolean permissionPromptsEnabled;
};
-[ChromeOnly,Exposed=System,HeaderFile="mozilla/AddonManagerWebAPI.h"]
+[ChromeOnly,Exposed=Window,HeaderFile="mozilla/AddonManagerWebAPI.h"]
interface AddonManagerPermissions {
static boolean isHostPermitted(DOMString host);
};