Browse Source

No need to hijack setInjectedScriptForOrigin

Cheng Zhao 9 years ago
parent
commit
c1facec5a6
1 changed files with 0 additions and 15 deletions
  1. 0 15
      lib/renderer/inspector.js

+ 0 - 15
lib/renderer/inspector.js

@@ -1,7 +1,4 @@
 window.onload = function () {
-  // Make sure |window.chrome| is defined for devtools extensions.
-  hijackSetInjectedScript(window.InspectorFrontendHost)
-
   // Use menu API to show context menu.
   window.InspectorFrontendHost.showContextMenuAtPoint = createMenu
 
@@ -9,18 +6,6 @@ window.onload = function () {
   window.WebInspector.createFileSelectorElement = createFileSelectorElement
 }
 
-const hijackSetInjectedScript = function (InspectorFrontendHost) {
-  const {setInjectedScriptForOrigin} = InspectorFrontendHost
-  InspectorFrontendHost.setInjectedScriptForOrigin = function (origin, source) {
-    const wrapped = `(function (...args) {
-      window.chrome = {}
-      const original = ${source}
-      original(...args)
-    })`
-    setInjectedScriptForOrigin(origin, wrapped)
-  }
-}
-
 var convertToMenuTemplate = function (items) {
   var fn, i, item, len, template
   template = []