blob: 7d5e87be16c0b425f5647a8163986fb1adb59e4a [file] [log] [blame]
avm999636d9c5fe2019-06-04 00:35:53 +02001chrome.storage.sync.get(null, function(items) {
avm99963db412d92020-12-31 19:27:59 +01002 if (items.loaddrafts || items.smei_sortdirection) {
avm99963b69eb3d2020-08-20 02:03:44 +02003 var startup =
4 JSON.parse(document.querySelector('html').getAttribute('data-startup'));
avm99963c19497f2019-08-23 00:15:11 +02005
6 if (items.loaddrafts) {
7 startup[4][13] = true;
8 }
9
avm99963b38b7412020-12-11 17:59:02 +010010 if (items.smei_sortdirection) {
11 if (!startup[1][6].includes(8))
12 startup[1][6].push(8);
13 }
14
avm99963b69eb3d2020-08-20 02:03:44 +020015 document.querySelector('html').setAttribute(
16 'data-startup', JSON.stringify(startup));
avm999636d9c5fe2019-06-04 00:35:53 +020017 }
avm999630bc113a2020-09-07 13:02:11 +020018
19 if (items.ccdarktheme) {
20 switch (items.ccdarktheme_mode) {
21 case 'switch':
22 if (items.ccdarktheme_switch_status == true)
23 injectStylesheet(chrome.runtime.getURL('injections/ccdarktheme.css'));
24 break;
25
26 case 'system':
27 injectStylesheet(chrome.runtime.getURL('injections/ccdarktheme.css'), {
28 'media': '(prefers-color-scheme: dark)',
29 });
30 break;
31 }
32 }
avm999636d9c5fe2019-06-04 00:35:53 +020033});