修改文字堆砌的问题

This commit is contained in:
yhy
2026-08-30 08:28:01 +08:00
parent ce79275d41
commit 3702527613
7 changed files with 284 additions and 103 deletions
+16 -3
View File
@@ -88,14 +88,27 @@ export function registerPrefs() {
});
}
export function ensureChatPapersStyles(doc: Document) {
export function ensureChatPapersStyles(doc: Document): void {
const id = "chatpapers-styles";
if (doc.getElementById(id)) return;
const base = `chrome://${config.addonRef}/content/chatpapers.css`;
const href =
typeof __env__ !== "undefined" && __env__ === "development"
? `${base}?v=${Date.now()}`
: base;
const existing = doc.getElementById(id) as HTMLLinkElement | null;
if (existing) {
if (typeof __env__ !== "undefined" && __env__ === "development") {
existing.href = href;
}
return;
}
const link = doc.createElement("link");
link.id = id;
link.rel = "stylesheet";
link.type = "text/css";
link.href = `chrome://${config.addonRef}/content/chatpapers.css`;
link.href = href;
doc.documentElement?.appendChild(link);
}