content-loaded

Promise telling you when the browser is ready

Usage no npm install needed!

<script type="module">
  import contentLoaded from 'https://cdn.skypack.dev/content-loaded';
</script>

README

content-loaded NPM version

use document.readyState and document.addEventListener('DOMContentLoaded') to resolve the Promise telling you when the browser is ready.

Quick example

import contentLoaded from 'content-loaded';

contentLoaded()
    .then(() => console.log('contentLoaded !'));