This commit is contained in:
ChuXun
2025-10-19 20:55:27 +08:00
parent e879ccefb3
commit 53f9554f38
99 changed files with 22308 additions and 2 deletions

22
js/firefox.js Normal file
View File

@@ -0,0 +1,22 @@
// 兼容Firefox
if (typeof (browser) == "object") {
function importScripts() {
for (let script of arguments) {
const js = document.createElement('script');
js.src = script;
document.head.appendChild(js);
}
}
// browser.windows.onFocusChanged.addListener 少一个参数
const _onFocusChanged = chrome.windows.onFocusChanged.addListener;
chrome.windows.onFocusChanged.addListener = function (listener, option) {
_onFocusChanged(listener);
};
browser.runtime.onInstalled.addListener(({ reason }) => {
if (reason == "install") {
browser.tabs.create({ url: "install.html" });
}
});
}