Bug 1459750 - Rename extension to policy where applicable r=mixedpuppy

This only changes some variable names. There is still work to do,
e.g. renaming "extension" in WebExtensionContentScript to "policy".
That will be handled in bug 1441886.

MozReview-Commit-ID: AqQErPyeFe7
This commit is contained in:
Rob Wu
2018-05-07 23:45:44 +02:00
parent e2599d63f2
commit dd63a22f3d

View File

@@ -195,8 +195,8 @@ DocumentManager = {
});
},
initExtension(extension) {
this.injectExtensionScripts(extension);
initExtension(policy) {
this.injectExtensionScripts(policy);
},
// Listeners
@@ -209,11 +209,11 @@ DocumentManager = {
// Script loading
injectExtensionScripts(extension) {
injectExtensionScripts(policy) {
for (let window of this.enumerateWindows()) {
let runAt = {document_start: [], document_end: [], document_idle: []};
for (let script of extension.contentScripts) {
for (let script of policy.contentScripts) {
if (script.matchesWindow(window)) {
runAt[script.runAt].push(script);
}
@@ -296,7 +296,7 @@ DocumentManager = {
ExtensionManager = {
// WeakMap<WebExtensionPolicy, Map<string, WebExtensionContentScript>>
registeredContentScripts: new DefaultWeakMap((extension) => new Map()),
registeredContentScripts: new DefaultWeakMap((policy) => new Map()),
init() {
MessageChannel.setupMessageManagers([Services.cpmm]);