]> git.wh0rd.org - chrome-ext/tabs-backup.git/blob - theme-init.js
makedist: normalize name
[chrome-ext/tabs-backup.git] / theme-init.js
1 // Load the theme override asap to help with initial loading/flashing.
2 function switchTheme(theme) {
3 const css = document.querySelector('link#theme-override');
4 if (theme == 'light' || theme == 'dark') {
5 css.href = `${theme}.css`;
6 } else {
7 css.href = '';
8 }
9 }
10 chrome.storage.local.get(function(items) {
11 switchTheme(items.prefs_theme);
12 });