blob: 52482c5eb44c4cb6cba81eee678ddb3ec5b77906 [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
avm99963b69eb3d2020-08-20 02:03:44 +020010 document.querySelector('html').setAttribute(
11 'data-startup', JSON.stringify(startup));
avm999636d9c5fe2019-06-04 00:35:53 +020012 }
avm999630bc113a2020-09-07 13:02:11 +020013
14 if (items.ccdarktheme) {
15 switch (items.ccdarktheme_mode) {
16 case 'switch':
17 if (items.ccdarktheme_switch_status == true)
18 injectStylesheet(chrome.runtime.getURL('injections/ccdarktheme.css'));
19 break;
20
21 case 'system':
22 injectStylesheet(chrome.runtime.getURL('injections/ccdarktheme.css'), {
23 'media': '(prefers-color-scheme: dark)',
24 });
25 break;
26 }
27 }
avm999636d9c5fe2019-06-04 00:35:53 +020028});