Scratch.canFetchResource -> Scratch.canFetch
This commit is contained in:
1 parent
795ceb1fb3
commit
5ccaee81d3
5 files changed
+35
-35
No files matched your search
@@ -11,7 +11,7 @@ const Scratch = {
|
||||
|
||||
// Stubs:
|
||||
/* eslint-disable no-unused-vars */
|
||||
canFetchResource: url => Promise.resolve(true),
|
||||
canFetch: url => Promise.resolve(true),
|
||||
canOpenWindow: url => Promise.resolve(true),
|
||||
canRedirect: url => Promise.resolve(true)
|
||||
/* eslint-enable no-unused-vars */
|
||||
|
||||
@@ -36,7 +36,7 @@ const setupUnsandboxedExtensionAPI = vm => new Promise(resolve => {
|
||||
global.Scratch.vm = vm;
|
||||
global.Scratch.renderer = vm.runtime.renderer;
|
||||
|
||||
global.Scratch.canFetchResource = async url => {
|
||||
global.Scratch.canFetch = async url => {
|
||||
const parsed = parseURL(url);
|
||||
if (!parsed) {
|
||||
return false;
|
||||
@@ -45,7 +45,7 @@ const setupUnsandboxedExtensionAPI = vm => new Promise(resolve => {
|
||||
if (parsed.protocol === 'blob:' || parsed.protocol === 'data:') {
|
||||
return true;
|
||||
}
|
||||
return vm.securityManager.canFetchResource(parsed.href);
|
||||
return vm.securityManager.canFetch(parsed.href);
|
||||
};
|
||||
|
||||
global.Scratch.canOpenWindow = async url => {
|
||||
|
||||
Reference in new issue
Block a user