Explorar el Código

Load using interval

simov hace 6 años
padre
commit
d49faae0ad
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      content/index.js

+ 6 - 1
content/index.js

@@ -191,7 +191,12 @@ if (document.readyState === 'complete') {
   mount()
 }
 else {
-  window.addEventListener('DOMContentLoaded', mount)
+  var timeout = setInterval(() => {
+    if (document.readyState === 'complete') {
+      clearInterval(timeout)
+      mount()
+    }
+  }, 0)
 }
 
 if (state.content.autoreload) {