ireade / caniuse-embed

📊 Embed realtime data from caniuse.com
https://caniuse.bitsofco.de
329 stars 21 forks source link

Document loading check #42

Closed nikitahl closed 7 months ago

nikitahl commented 7 months ago

This PR contains a fix for the DOMContentLoaded event inside the src/caniuse-embed.js. For cases when the caniuse-embed.js script is added after the document has completed loading e.g. lazy loading an embed (which is my case).

PR contents:

  1. Updated package.json file, in order to run the npm run start command without errors.
  2. Updated gulpfile.js file, according to the current docs.
  3. Condition for the DOMContentLoaded event to check whether the document has completed loading as suggested on MDN.

Please consider reviewing this PR and merging it if you think this fix is appropriate.

netlify[bot] commented 7 months ago

Deploy request for caniuse-embed accepted.

Name Link
Latest commit 60c4154f2a0e666aae6f144c1180191af9e2751f
Latest deploy log https://app.netlify.com/sites/caniuse-embed/deploys/65d50c553da99700082dc083
ireade commented 7 months ago

Thanks for submitting this @nikitahl ! This looks good and works fine for me locally, will go ahead and merge now