override importScripts with error-function so that web extension cannot use them, https://github.com/microsoft/vscode/issues/128080

This commit is contained in:
Johannes Rieken 2021-07-14 11:28:34 +02:00
parent 9f4c43ff1b
commit 28f4bd6ef8
No known key found for this signature in database
GPG key ID: 96634B5AF12F8798

View file

@ -31,6 +31,7 @@ declare namespace self {
let dispatchEvent: any;
let indexedDB: { open: any, [k: string]: any };
let caches: { open: any, [k: string]: any };
let importScripts: any;
}
const nativeClose = self.close.bind(self);
@ -39,6 +40,8 @@ self.close = () => console.trace(`'close' has been blocked`);
const nativePostMessage = postMessage.bind(self);
self.postMessage = () => console.trace(`'postMessage' has been blocked`);
self.importScripts = () => { throw new Error(`'importScripts' has been blocked`); };
// const nativeAddEventListener = addEventListener.bind(self);
self.addEventListener = () => console.trace(`'addEventListener' has been blocked`);