From 1cba6543a42561c6691736d58f45e97f4832912b Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 4 Oct 2017 15:35:04 -0700 Subject: [PATCH] Begin implementing sync injection idea --- app/scripts/contentscript.js | 3 +-- gulpfile.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index b4708189e..59e7f08ce 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -7,7 +7,7 @@ const ObjectMultiplex = require('obj-multiplex') const extension = require('extensionizer') const PortStream = require('./lib/port-stream.js') -const inpageText = fs.readFileSync(path.join(__dirname, 'inpage.js')).toString() +const inpageText = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', 'chrome', 'scripts', 'inpage.js')).toString() + '//# sourceURL=' + extension.extension.getURL('scripts/inpage.js') + '\n' // Eventually this streaming injection could be replaced with: // https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.exportFunction @@ -25,7 +25,6 @@ function setupInjection () { try { // inject in-page script var scriptTag = document.createElement('script') - scriptTag.src = extension.extension.getURL('scripts/inpage.js') scriptTag.textContent = inpageText scriptTag.onload = function () { this.parentNode.removeChild(this) } var container = document.head || document.documentElement diff --git a/gulpfile.js b/gulpfile.js index ac36cf983..14e26ed2e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -186,8 +186,8 @@ jsFiles.forEach((jsFile) => { gulp.task(`build:js:${jsFile}`, bundleTask({ watch: false, label: jsFile, filename: `${jsFile}.js` })) }) -gulp.task('dev:js', gulp.parallel(...jsDevStrings)) -gulp.task('build:js', gulp.parallel(...jsBuildStrings)) +gulp.task('dev:js', gulp.series(jsDevStrings.shift(), gulp.parallel(...jsDevStrings))) +gulp.task('build:js', gulp.series(jsBuildStrings.shift(), gulp.parallel(...jsBuildStrings))) // disc bundle analyzer tasks