mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-09 12:51:09 +02:00
- This was the last non-schema-generated API in content scripts. MozReview-Commit-ID: FaIOCHoircf --HG-- extra : rebase_source : 7bab2249a7462a581e493f7aa937df45cb895107
25 lines
687 B
JavaScript
25 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);
|