修改文字堆砌的问题
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user