зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1253646 - Implement browser.extension.isAllowedFileSchemeAccess. r=kmag
MozReview-Commit-ID: 85UL3ATGrfB --HG-- extra : transplant_source : %C9%C3%EE%B9/%7C%8F%7DMO%AE5%7C%02%25%22%9E%D8%08%09
This commit is contained in:
Родитель
eb48aa54c0
Коммит
0cb9971fb4
|
@ -38,6 +38,10 @@ extensions.registerSchemaAPI("extension", null, (extension, context) => {
|
|||
isAllowedIncognitoAccess() {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
|
||||
isAllowedFileSchemeAccess() {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
|
|
@ -117,7 +117,6 @@
|
|||
},
|
||||
{
|
||||
"name": "isAllowedFileSchemeAccess",
|
||||
"unsupported": true,
|
||||
"type": "function",
|
||||
"description": "Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.",
|
||||
"async": "callback",
|
||||
|
|
|
@ -33,6 +33,26 @@ add_task(function* test_is_allowed_incognito_access() {
|
|||
info("extension unloaded");
|
||||
});
|
||||
|
||||
add_task(function* test_is_allowed_file_scheme_access() {
|
||||
function backgroundScript() {
|
||||
browser.extension.isAllowedFileSchemeAccess().then(isAllowedFileSchemeAccess => {
|
||||
browser.test.assertEq(true, isAllowedFileSchemeAccess, "isAllowedFileSchemeAccess is true");
|
||||
browser.test.notifyPass("isAllowedFileSchemeAccess");
|
||||
});
|
||||
}
|
||||
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
background: `(${backgroundScript})()`,
|
||||
manifest: {},
|
||||
});
|
||||
|
||||
yield extension.startup();
|
||||
info("extension loaded");
|
||||
yield extension.awaitFinish("isAllowedFileSchemeAccess")
|
||||
yield extension.unload();
|
||||
info("extension unloaded");
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
Загрузка…
Ссылка в новой задаче