From 253abd60fca5a6efb1a2e0ecbe305989a852ec32 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 28 Mar 2018 21:29:57 -0700 Subject: [PATCH] build - extension - move js files to toplevel --- app/home.html | 2 +- app/manifest.json | 10 +++++----- app/notification.html | 2 +- app/popup.html | 2 +- app/scripts/contentscript.js | 6 +++--- gulpfile.js | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/home.html b/app/home.html index bb8e936a3..4fad0f993 100644 --- a/app/home.html +++ b/app/home.html @@ -7,6 +7,6 @@
- + diff --git a/app/manifest.json b/app/manifest.json index a20f9b976..1982b4820 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -27,8 +27,8 @@ "default_locale": "en", "background": { "scripts": [ - "scripts/chromereload.js", - "scripts/background.js" + "chromereload.js", + "background.js" ], "persistent": true }, @@ -48,7 +48,7 @@ "https://*/*" ], "js": [ - "scripts/contentscript.js" + "contentscript.js" ], "run_at": "document_start", "all_frames": true @@ -62,11 +62,11 @@ "https://*.infura.io/" ], "web_accessible_resources": [ - "scripts/inpage.js" + "inpage.js" ], "externally_connectable": { "matches": [ "https://metamask.io/*" ] } -} \ No newline at end of file +} diff --git a/app/notification.html b/app/notification.html index 2255ca2c1..457ba7137 100644 --- a/app/notification.html +++ b/app/notification.html @@ -11,6 +11,6 @@
- + diff --git a/app/popup.html b/app/popup.html index 109487d3e..3acfd8c55 100644 --- a/app/popup.html +++ b/app/popup.html @@ -7,6 +7,6 @@
- + diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 7abbc60e7..2098fae27 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -7,8 +7,8 @@ const ObjectMultiplex = require('obj-multiplex') const extension = require('extensionizer') const PortStream = require('./lib/port-stream.js') -const inpageContent = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', 'chrome', 'scripts', 'inpage.js')).toString() -const inpageSuffix = '//# sourceURL=' + extension.extension.getURL('scripts/inpage.js') + '\n' +const inpageContent = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', 'chrome', 'inpage.js')).toString() +const inpageSuffix = '//# sourceURL=' + extension.extension.getURL('inpage.js') + '\n' const inpageBundle = inpageContent + inpageSuffix // Eventually this streaming injection could be replaced with: @@ -96,7 +96,7 @@ function logStreamDisconnectWarning (remoteLabel, err) { } function shouldInjectWeb3 () { - return doctypeCheck() && suffixCheck() + return doctypeCheck() && suffixCheck() && documentElementCheck() && !blacklistedDomainCheck() } diff --git a/gulpfile.js b/gulpfile.js index 68618dfb4..cd523a107 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -75,7 +75,7 @@ gulp.task('copy:fonts', copyTask({ })) gulp.task('copy:reload', copyTask({ source: './app/scripts/', - destinations: commonPlatforms.map(platform => `./dist/${platform}/scripts`), + destinations: commonPlatforms.map(platform => `./dist/${platform}`), pattern: '/chromereload.js', })) gulp.task('copy:html', copyTask({ @@ -243,10 +243,10 @@ function createTasksForBuildJsExtension({ buildJsFiles, taskPrefix, devMode, bun const nonInpageFiles = buildJsFiles.filter(file => file !== 'inpage') const buildPhase1 = ['inpage'] const buildPhase2 = nonInpageFiles - const destinations = browserPlatforms.map(platform => `./dist/${platform}/scripts`) + const destinations = browserPlatforms.map(platform => `./dist/${platform}`) bundleTaskOpts = Object.assign({ buildSourceMaps: true, - sourceMapDir: devMode ? './' : '../../sourcemaps', + sourceMapDir: devMode ? './' : '../sourcemaps', minifyBuild: !devMode, buildWithFullPaths: devMode, }, bundleTaskOpts)