소스 검색

Load using interval

simov 6 년 전
부모
커밋
d49faae0ad
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  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) {