1
0
mirror of https://gitee.com/bitdance-team/chrome-extension synced 2025-10-08 08:45:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

合并前准备:删除非必需文件,规范扩展目录结构

This commit is contained in:
2022-02-05 17:47:04 +08:00
parent 6a81071152
commit 6b53314e6f
78 changed files with 0 additions and 11917 deletions

View File

@@ -0,0 +1,25 @@
const btn = document.querySelector("#switch");
chrome.storage.sync.get("linkOpen", ({ linkOpen }) => {
btn.checked = linkOpen;
});
btn.addEventListener("change", () => {
if (btn.checked) {
chrome.storage.sync.set({ linkOpen: true });
} else {
chrome.storage.sync.set({ linkOpen: false });
}
// 获取当前tab窗口
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
chrome.scripting.executeScript({
target: { tabId: tabs[0].id },
func: refreshPage,
});
});
});
// 刷新页面
function refreshPage() {
window.location.reload();
}