Skip to content

Commit

Permalink
fix: GM_addStyle与tm管理器插入地方一致
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Nov 24, 2021
1 parent d668452 commit 0375282
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pkg/frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
export function addStyle(css: string): HTMLElement {
let dom = document.createElement('style');
dom.innerHTML = css;
document.documentElement.appendChild(dom);
return dom;
if (document.head) {
return document.head.appendChild(dom);
}
return document.documentElement.appendChild(dom);
}

0 comments on commit 0375282

Please sign in to comment.