first commit
commit
ec251e8d0e
|
@ -0,0 +1,4 @@
|
|||
chrome.browserAction.onClicked.addListener(function(tab) {
|
||||
chrome.tabs.create({ url: 'chrome://flags/#enable-force-dark' });
|
||||
});
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Auto Dark Mode Toggle",
|
||||
"version": "1.0",
|
||||
"description": "Toggle the 'Auto Dark Mode for Web Contents' flag in Chrome://flags",
|
||||
"icons": {
|
||||
"16": "icon.png",
|
||||
"48": "icon.png",
|
||||
"128": "icon.png"
|
||||
},
|
||||
"browser_action": {
|
||||
"default_popup": "popup.html"
|
||||
},
|
||||
"permissions": [
|
||||
"tabs"
|
||||
],
|
||||
"background": {
|
||||
"scripts": ["background.js"],
|
||||
"persistent": false
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Auto Dark Mode Toggle</title>
|
||||
<script src="popup.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Auto Dark Mode Toggle</h1>
|
||||
<button id="toggleButton">Toggle Auto Dark Mode</button>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var toggleButton = document.getElementById('toggleButton');
|
||||
|
||||
chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) {
|
||||
var tab = tabs[0];
|
||||
var url = tab.url;
|
||||
|
||||
toggleButton.addEventListener('click', function() {
|
||||
chrome.tabs.update(tab.id, { url: 'chrome://flags/#enable-force-dark' });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue