Browse Source

fix: remove useless code

Gerald 8 years ago
parent
commit
d5cbb70acd
2 changed files with 5 additions and 8 deletions
  1. 0 1
      src/injected/web/bridge.js
  2. 5 7
      src/injected/web/index.js

+ 0 - 1
src/injected/web/bridge.js

@@ -2,5 +2,4 @@ import { noop } from './helpers';
 
 export default {
   load: noop,
-  checkLoad: noop,
 };

+ 5 - 7
src/injected/web/index.js

@@ -83,12 +83,6 @@ function onLoadScripts(data) {
     run(end);
     setTimeout(run, 0, idle);
   };
-  bridge.checkLoad = () => {
-    if (!state && includes(['interactive', 'complete'], document.readyState)) {
-      state = 1;
-    }
-    if (state) bridge.load();
-  };
   const listMap = {
     'document-start': start,
     'document-idle': idle,
@@ -107,7 +101,11 @@ function onLoadScripts(data) {
     });
     run(start);
   }
-  bridge.checkLoad();
+  if (!state && includes(['interactive', 'complete'], document.readyState)) {
+    state = 1;
+  }
+  if (state) bridge.load();
+
   function buildCode(script) {
     const requireKeys = script.meta.require || [];
     const pathMap = script.custom.pathMap || {};