content-loaded 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 !'));