Revert "修改点击逻辑"

This reverts commit 0e27def107.
master
LIU CHAO 2023-07-30 21:49:55 +08:00
parent 0e27def107
commit f8578f5030
2 changed files with 20 additions and 27 deletions

View File

@ -1,13 +1,4 @@
chrome.browserAction.onClicked.addListener(function(tab) { chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) { chrome.tabs.create({ url: 'chrome://flags/#enable-force-dark' });
var tab = tabs[0];
var url = tab.url;
if (url === 'chrome://flags/#enable-force-dark') {
chrome.tabs.update(tab.id, { url: 'chrome://flags/' });
} else {
chrome.tabs.update(tab.id, { url: 'chrome://flags/#enable-force-dark' });
}
});
}); });

View File

@ -8,12 +8,14 @@
"48": "icon.png", "48": "icon.png",
"128": "icon.png" "128": "icon.png"
}, },
"background": { "browser_action": {
"scripts": ["background.js"], "default_popup": "popup.html"
"persistent": false
}, },
"permissions": [ "permissions": [
"tabs" "tabs"
] ],
"background": {
"scripts": ["background.js"],
"persistent": false
}
} }