blob: b9c7f58832d4a49753c395d9c29e2e61e86fc1e8 [file] [log] [blame]
import {injectStylesheet} from '../../common/contentScriptsUtils';
import {getOptions} from '../../common/options/optionsUtils.js';
import FlattenThreadsReplyActionHandler from './flattenThreads/replyActionHandler.js';
getOptions(null).then(options => {
/* IMPORTANT NOTE: Remember to change this when changing the "ifs" below!! */
if (options.fixpekb269560789) {
var startup =
JSON.parse(document.querySelector('html').getAttribute('data-startup'));
if (options.fixpekb269560789) {
if (startup[1]?.[1]?.[8]?.[7]) {
delete startup[1]?.[1]?.[8]?.[7];
}
}
document.querySelector('html').setAttribute(
'data-startup', JSON.stringify(startup));
}
if (options.uispacing) {
injectStylesheet(chrome.runtime.getURL('css/ui_spacing/shared.css'));
injectStylesheet(chrome.runtime.getURL('css/ui_spacing/console.css'));
}
const flattenThreadsReplyActionHandler =
new FlattenThreadsReplyActionHandler(options);
flattenThreadsReplyActionHandler.handleIfApplicable();
});