- This was the last non-schema-generated API in content scripts. MozReview-Commit-ID: FaIOCHoircf
26 lines
687 B
JavaScript
26 lines
687 B
JavaScript
"use strict";
|
|
|
|
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
|
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
|
|
|
function extensionApiFactory(context) {
|
|
return {
|
|
extension: {
|
|
getURL(url) {
|
|
return context.extension.baseURI.resolve(url);
|
|
},
|
|
|
|
get lastError() {
|
|
return context.lastError;
|
|
},
|
|
|
|
get inIncognitoContext() {
|
|
return PrivateBrowsingUtils.isContentWindowPrivate(context.contentWindow);
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
extensions.registerSchemaAPI("extension", "addon_child", extensionApiFactory);
|
|
extensions.registerSchemaAPI("extension", "content_child", extensionApiFactory);
|