13 lines
432 B
JavaScript
13 lines
432 B
JavaScript
chrome.browserAction.onClicked.addListener(function(tab) {
|
|
chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) {
|
|
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' });
|
|
}
|
|
});
|
|
});
|
|
|