瀏覽代碼

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) {