File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 11let s = document . createElement ( 'script' ) ;
2+ s . type = 'text/javascript' ;
23
34if ( process . env . NODE_ENV === 'production' ) {
45 const script = require ( 'raw!tmp/page.bundle.js' ) ;
56 s . appendChild ( document . createTextNode ( script ) ) ;
7+ ( document . head || document . documentElement ) . appendChild ( s ) ;
8+ s . parentNode . removeChild ( s ) ;
69} else {
710 s . src = chrome . extension . getURL ( 'js/page.bundle.js' ) ;
11+ s . onload = function ( ) {
12+ this . parentNode . removeChild ( this ) ;
13+ } ;
14+ ( document . head || document . documentElement ) . appendChild ( s ) ;
815}
9-
10- s . type = 'text/javascript' ;
11- s . onload = function ( ) {
12- this . parentNode . removeChild ( this ) ;
13- } ;
14- ( document . head || document . documentElement ) . appendChild ( s ) ;
Original file line number Diff line number Diff line change @@ -46,10 +46,8 @@ const injectOptions = newOptions => {
4646 let s = document . createElement ( 'script' ) ;
4747 s . type = 'text/javascript' ;
4848 s . appendChild ( document . createTextNode ( 'window.devToolsOptions=' + JSON . stringify ( options ) ) ) ;
49- s . onload = function ( ) {
50- this . parentNode . removeChild ( this ) ;
51- } ;
5249 ( document . head || document . documentElement ) . appendChild ( s ) ;
50+ s . parentNode . removeChild ( s ) ;
5351} ;
5452
5553export const getOptionsFromBg = ( ) => {
You can’t perform that action at this time.
0 commit comments