diff --git a/src/TabManager.ts b/src/TabManager.ts index 7f956fa..e10d176 100644 --- a/src/TabManager.ts +++ b/src/TabManager.ts @@ -59,12 +59,12 @@ async function loadPage(page: string, elem: HTMLElement) { processHTML(elem, page); // Save result to cache - cache.set(key, elem.innerHTML, CURRENT_VERSION).then(() => { + cache.set(key, elem.outerHTML, CURRENT_VERSION).then(() => { console.log(`${page}: saved to cache`); }); } else { // Set cached content as HTML - elem.innerHTML = html; + elem.outerHTML = html; } bindFunctions(elem, page); diff --git a/src/userscript.ts b/src/userscript.ts index 125f853..b6d74c6 100644 --- a/src/userscript.ts +++ b/src/userscript.ts @@ -4,9 +4,12 @@ import { findParent } from "./utils"; // This is used for cache busting when userscript changes significantly. // Only change it when you made changes to the processHTML part! -export const CURRENT_VERSION = "7930f961710641f022ef0cd3ad3277ffd4eab7eb"; +export const CURRENT_VERSION = "df914edcb5522670309ceb8dfd0195dc70fb81d4"; function chemistryFixups(root: HTMLElement) { + // Enable page-specific CSS rules + root.classList.add("bchem"); + // Fix inconsistencies with

on random parts // Ideally I'd like a

or something on every part, wrapping it completely, but for now let's just kill 'em root @@ -135,9 +138,6 @@ function chemistryFixups(root: HTMLElement) { if (overdose) overdose.parentElement.removeChild(overdose); if (addiction) addiction.parentElement.removeChild(addiction); }); - - // Enable page-specific CSS rules - root.classList.add("bchem"); } export function processHTML(root: HTMLElement, docname: string): void {