Add theme support with dynamic icons
This commit is contained in:
parent
b29d5c702e
commit
7e64a428ac
5 changed files with 132 additions and 65 deletions
|
@ -1,4 +1,10 @@
|
|||
const aiLog = (await import(browser.runtime.getURL("logger.js"))).aiLog;
|
||||
const storage = (globalThis.messenger ?? browser).storage;
|
||||
const { theme } = await storage.local.get('theme');
|
||||
const mode = (theme || 'auto') === 'auto'
|
||||
? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
||||
: theme;
|
||||
document.documentElement.dataset.theme = mode;
|
||||
|
||||
const qMid = parseInt(new URLSearchParams(location.search).get("mid"), 10);
|
||||
if (!isNaN(qMid)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue