details-polyfill icon indicating copy to clipboard operation
details-polyfill copied to clipboard

fix: only load polyfill when dom is loaded

Open NickDJM opened this issue 5 years ago • 2 comments

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

NickDJM avatar Jan 29 '20 20:01 NickDJM

Tested on Chrome, Firefox, Safari, (old) Edge, and IE.

All work as expected.

NickDJM avatar Jan 29 '20 20:01 NickDJM

Thanks for this, I'll check it out when I get the time!

rstacruz avatar Jan 12 '21 01:01 rstacruz