add globalThis.ContextType
This commit is contained in:
@@ -40,7 +40,8 @@
|
|||||||
],
|
],
|
||||||
"globals": {
|
"globals": {
|
||||||
"GM": true,
|
"GM": true,
|
||||||
"unsafeWindow": true
|
"unsafeWindow": true,
|
||||||
|
"globalThis": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ import { sendTabMsg } from "./libs/msg";
|
|||||||
import { trySyncAllSubRules } from "./libs/subRules";
|
import { trySyncAllSubRules } from "./libs/subRules";
|
||||||
import { tryClearCaches } from "./libs";
|
import { tryClearCaches } from "./libs";
|
||||||
|
|
||||||
|
globalThis.ContextType = "BACKGROUND";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 插件安装
|
* 插件安装
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -13,3 +13,5 @@ function _browser() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const browser = _browser();
|
export const browser = _browser();
|
||||||
|
|
||||||
|
export const isBg = () => globalThis?.ContextType === "BACKGROUND";
|
||||||
|
|||||||
Reference in New Issue
Block a user