details-polyfill
details-polyfill copied to clipboard
fix: only load polyfill when dom is loaded
The polyfill tries to load itself immediately, which can cause errors if the DOM isn't loaded yet.
This PR implements a check to see if the DOM is loaded and will not run the support check until it has.
Fixes #7
Tested on Chrome, Firefox, Safari, (old) Edge, and IE.
All work as expected.
Thanks for this, I'll check it out when I get the time!