-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added "Use system theme (auto)" to context menu
- Loading branch information
1 parent
6805a9a
commit 39b7fe1
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,22 @@ function toggleTheme() { | |
} | ||
|
||
browser.action.onClicked.addListener(toggleTheme); | ||
|
||
function toggleSystemTheme() { | ||
browser.management.get("[email protected]").then(info => { | ||
browser.management.setEnabled("[email protected]", !info.enabled); | ||
}); | ||
} | ||
|
||
browser.menus.create({ | ||
id: "use-systemtheme", | ||
type: "normal", | ||
title: "Use system theme (auto)", | ||
contexts: ["action"], | ||
icons: { | ||
"16": "icons/browser.svg", | ||
"32": "icons/browser.svg" | ||
}, | ||
}); | ||
|
||
browser.menus.onClicked.addListener(toggleSystemTheme); |