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
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
"use strict";
|
|
|
|
extensions.registerSchemaAPI("extension", "addon_parent", context => {
|
|
let {extension} = context;
|
|
return {
|
|
extension: {
|
|
getViews: function(fetchProperties) {
|
|
let result = Cu.cloneInto([], context.cloneScope);
|
|
|
|
for (let view of extension.views) {
|
|
if (!view.active) {
|
|
continue;
|
|
}
|
|
if (fetchProperties !== null) {
|
|
if (fetchProperties.type !== null && view.type != fetchProperties.type) {
|
|
continue;
|
|
}
|
|
|
|
if (fetchProperties.windowId !== null && view.windowId != fetchProperties.windowId) {
|
|
continue;
|
|
}
|
|
}
|
|
|
|
result.push(view.contentWindow);
|
|
}
|
|
|
|
return result;
|
|
},
|
|
|
|
get lastError() {
|
|
// TODO(robwu): See comment about lastError in ext-runtime.js
|
|
return context.lastError;
|
|
},
|
|
|
|
isAllowedIncognitoAccess() {
|
|
return Promise.resolve(true);
|
|
},
|
|
|
|
isAllowedFileSchemeAccess() {
|
|
return Promise.resolve(false);
|
|
},
|
|
},
|
|
};
|
|
});
|
|
|