From e949e6b11869e584e4f5e6684bd7c4d04b86ef0b Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 18 Apr 2016 11:49:06 -0700 Subject: [PATCH] contentscript - append inpage as first child --- app/scripts/contentscript.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 105f24988..a256a3f5b 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -7,7 +7,8 @@ var scriptTag = document.createElement('script') scriptTag.src = chrome.extension.getURL('scripts/inpage.js') scriptTag.onload = function() { this.parentNode.removeChild(this) } 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 var pageStream = new LocalMessageDuplexStream({