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

override document.querySelector? #79

Open
TheDevelolper opened this issue Aug 20, 2022 · 1 comment
Open

override document.querySelector? #79

TheDevelolper opened this issue Aug 20, 2022 · 1 comment

Comments

@TheDevelolper
Copy link

So I'm trying to make a web component library that uses a shadow DOM.

I wondered if it was possible to override document.querySelector? Perhaps document.querySelector could be cloned to some other function then your code could call the clone. Then document.querySelector could be overridden to call your deep query selectors?

Then the consumer doesn't have to do anything different from what they're used to?

@NikhilVerma
Copy link

This library still uses native query selector internally. I've modified and published it as a ponyfill (crediting the original project ofcourse) https://www.npmjs.com/package/query-selector-ponyfill

This just needs to be included in your project and it should work out of the box

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