fix GM.xmlHttpRequest & use GM/unsafeWindow global

This commit is contained in:
Gabe Yuan
2023-08-16 11:38:53 +08:00
parent 819018c3bd
commit f1f15c7eb1
4 changed files with 33 additions and 37 deletions

View File

@@ -16,12 +16,8 @@ import { Translator } from "./libs/translator";
document.location.href.includes(process.env.REACT_APP_OPTIONSPAGE) ||
document.location.href.includes(process.env.REACT_APP_OPTIONSPAGE2)
) {
window.unsafeWindow.GM = window.GM;
window.unsafeWindow.GM_xmlhttpRequest = window.GM_xmlhttpRequest;
window.unsafeWindow.GM_setValue = window.GM_setValue;
window.unsafeWindow.GM_getValue = window.GM_getValue;
window.unsafeWindow.GM_deleteValue = window.GM_deleteValue;
window.unsafeWindow.APP_NAME = process.env.REACT_APP_NAME;
unsafeWindow.GM = GM;
unsafeWindow.APP_NAME = process.env.REACT_APP_NAME;
return;
}