2023-08-30 18:05:37 +08:00
|
|
|
|
// import { CLIENT_EXTS, CLIENT_USERSCRIPT, CLIENT_WEB } from "../config";
|
2023-08-05 18:15:01 +08:00
|
|
|
|
|
2023-07-20 13:45:41 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 浏览器兼容插件,另可用于判断是插件模式还是网页模式,方便开发
|
|
|
|
|
|
* @returns
|
|
|
|
|
|
*/
|
|
|
|
|
|
function _browser() {
|
|
|
|
|
|
try {
|
|
|
|
|
|
return require("webextension-polyfill");
|
|
|
|
|
|
} catch (err) {
|
2025-09-24 23:24:00 +08:00
|
|
|
|
// kissLog("browser", err);
|
2023-07-20 13:45:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-04 16:48:40 +08:00
|
|
|
|
export const browser = _browser();
|
2023-09-20 16:02:17 +08:00
|
|
|
|
|
|
|
|
|
|
export const isBg = () => globalThis?.ContextType === "BACKGROUND";
|