Skip to content

Commit 0375282

Browse files
committed
fix: GM_addStyle与tm管理器插入地方一致
1 parent d668452 commit 0375282

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/pkg/frontend.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
export function addStyle(css: string): HTMLElement {
44
let dom = document.createElement('style');
55
dom.innerHTML = css;
6-
document.documentElement.appendChild(dom);
7-
return dom;
6+
if (document.head) {
7+
return document.head.appendChild(dom);
8+
}
9+
return document.documentElement.appendChild(dom);
810
}

0 commit comments

Comments
 (0)