Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When my document did not has a head element? #216

Open
zzlb0224 opened this issue Jun 11, 2024 · 1 comment
Open

When my document did not has a head element? #216

zzlb0224 opened this issue Jun 11, 2024 · 1 comment

Comments

@zzlb0224
Copy link

zzlb0224 commented Jun 11, 2024

In this funciton

/**
 * Injects CSS code into the document's <head>
 */
export const useStyleSheet = (nodeRef: RefObject<HTMLDivElement>): void => {
        parentDocument.head.appendChild(styleElement);

To

 (parentDocument.head || parentDocument.body || parentDocument.children[0] || parentDocument).appendChild(styleElement);

@zzlb0224
Copy link
Author

I use this in Zotero. It based on the firefox 115. The head is null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant