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

Pass a custom document object to the options of handle #21

Closed
thjungers opened this issue Mar 28, 2023 · 1 comment
Closed

Pass a custom document object to the options of handle #21

thjungers opened this issue Mar 28, 2023 · 1 comment

Comments

@thjungers
Copy link
Contributor

Passing a custom document object can be useful. My use case is shadow DOMs: the contents of the shadow DOMs are not available to document.querySelectorAll, but are available to shadowRoot.querySelectorAll.

Although not documented, this plugin accepts a document option in init, which defaults to document (i.e. window.document). This was added by commit 6d6569d.
However, this change does not support passing a custom document to the handle function. This would allow using a different document object within the same project.

I am preparing a pull request to solve this.

@thjungers thjungers changed the title Pass a different document object to the options of handle Pass a custom document object to the options of handle Mar 28, 2023
@mthh
Copy link
Owner

mthh commented Mar 28, 2023

That's a good idea, thanks.

I will also add some documentation for the document option that can be given to the init function, thanks for the reminder.

@mthh mthh closed this as completed in c793834 Mar 28, 2023
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

2 participants