blob: f0bda9b92d1f5e5bd22aba532b1dee3614387bb2 [file] [log] [blame]
avm999636d9c5fe2019-06-04 00:35:53 +02001chrome.storage.sync.get(null, function(items) {
avm999634ddca932020-08-15 18:22:34 +02002 if (items.loaddrafts) {
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});