Prevent chrome API access (#583)

`chrome.runtime.connect` & `chrome.runtime.sendMessage` are still accessible to userscripts.
This commit is contained in:
erosman
2025-05-09 20:56:50 +03:30
committed by GitHub
parent 6977b6b240
commit 7e52f30052

View File

@@ -18,6 +18,7 @@ globalThis.initCustomAPIForUserScripts = grants => {
// Clear access to privileged API to prevent userscripts from communicating
// to the privileged backend.
globalThis.browser = undefined;
globalThis.chrome = undefined;
if (grants.includes("GM_info")) {
// Example of an API that retrieves information: