contentscript - append inpage as first child

feature/default_network_editable
kumavis 9 years ago
parent 83b8741bbb
commit e949e6b118
  1. 3
      app/scripts/contentscript.js

@ -7,7 +7,8 @@ var scriptTag = document.createElement('script')
scriptTag.src = chrome.extension.getURL('scripts/inpage.js') scriptTag.src = chrome.extension.getURL('scripts/inpage.js')
scriptTag.onload = function() { this.parentNode.removeChild(this) } scriptTag.onload = function() { this.parentNode.removeChild(this) }
var container = document.head || document.documentElement var container = document.head || document.documentElement
container.appendChild(scriptTag) // append as first child
container.insertBefore(scriptTag, container.children[0])
// setup communication to page and plugin // setup communication to page and plugin
var pageStream = new LocalMessageDuplexStream({ var pageStream = new LocalMessageDuplexStream({

Loading…
Cancel
Save