mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
build - extension - move js files to toplevel
This commit is contained in:
parent
b88119c238
commit
253abd60fc
@ -7,6 +7,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app-content"></div>
|
<div id="app-content"></div>
|
||||||
<script src="./scripts/ui.js" type="text/javascript" charset="utf-8"></script>
|
<script src="./ui.js" type="text/javascript" charset="utf-8"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"background": {
|
"background": {
|
||||||
"scripts": [
|
"scripts": [
|
||||||
"scripts/chromereload.js",
|
"chromereload.js",
|
||||||
"scripts/background.js"
|
"background.js"
|
||||||
],
|
],
|
||||||
"persistent": true
|
"persistent": true
|
||||||
},
|
},
|
||||||
@ -48,7 +48,7 @@
|
|||||||
"https://*/*"
|
"https://*/*"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
"scripts/contentscript.js"
|
"contentscript.js"
|
||||||
],
|
],
|
||||||
"run_at": "document_start",
|
"run_at": "document_start",
|
||||||
"all_frames": true
|
"all_frames": true
|
||||||
@ -62,11 +62,11 @@
|
|||||||
"https://*.infura.io/"
|
"https://*.infura.io/"
|
||||||
],
|
],
|
||||||
"web_accessible_resources": [
|
"web_accessible_resources": [
|
||||||
"scripts/inpage.js"
|
"inpage.js"
|
||||||
],
|
],
|
||||||
"externally_connectable": {
|
"externally_connectable": {
|
||||||
"matches": [
|
"matches": [
|
||||||
"https://metamask.io/*"
|
"https://metamask.io/*"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body class="notification" style="height:600px;">
|
<body class="notification" style="height:600px;">
|
||||||
<div id="app-content"></div>
|
<div id="app-content"></div>
|
||||||
<script src="./scripts/ui.js" type="text/javascript" charset="utf-8"></script>
|
<script src="./ui.js" type="text/javascript" charset="utf-8"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -7,6 +7,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body style="width:357px; height:600px;">
|
<body style="width:357px; height:600px;">
|
||||||
<div id="app-content"></div>
|
<div id="app-content"></div>
|
||||||
<script src="./scripts/ui.js" type="text/javascript" charset="utf-8"></script>
|
<script src="./ui.js" type="text/javascript" charset="utf-8"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -7,8 +7,8 @@ const ObjectMultiplex = require('obj-multiplex')
|
|||||||
const extension = require('extensionizer')
|
const extension = require('extensionizer')
|
||||||
const PortStream = require('./lib/port-stream.js')
|
const PortStream = require('./lib/port-stream.js')
|
||||||
|
|
||||||
const inpageContent = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', 'chrome', 'scripts', 'inpage.js')).toString()
|
const inpageContent = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', 'chrome', 'inpage.js')).toString()
|
||||||
const inpageSuffix = '//# sourceURL=' + extension.extension.getURL('scripts/inpage.js') + '\n'
|
const inpageSuffix = '//# sourceURL=' + extension.extension.getURL('inpage.js') + '\n'
|
||||||
const inpageBundle = inpageContent + inpageSuffix
|
const inpageBundle = inpageContent + inpageSuffix
|
||||||
|
|
||||||
// Eventually this streaming injection could be replaced with:
|
// Eventually this streaming injection could be replaced with:
|
||||||
@ -96,7 +96,7 @@ function logStreamDisconnectWarning (remoteLabel, err) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function shouldInjectWeb3 () {
|
function shouldInjectWeb3 () {
|
||||||
return doctypeCheck() && suffixCheck()
|
return doctypeCheck() && suffixCheck()
|
||||||
&& documentElementCheck() && !blacklistedDomainCheck()
|
&& documentElementCheck() && !blacklistedDomainCheck()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ gulp.task('copy:fonts', copyTask({
|
|||||||
}))
|
}))
|
||||||
gulp.task('copy:reload', copyTask({
|
gulp.task('copy:reload', copyTask({
|
||||||
source: './app/scripts/',
|
source: './app/scripts/',
|
||||||
destinations: commonPlatforms.map(platform => `./dist/${platform}/scripts`),
|
destinations: commonPlatforms.map(platform => `./dist/${platform}`),
|
||||||
pattern: '/chromereload.js',
|
pattern: '/chromereload.js',
|
||||||
}))
|
}))
|
||||||
gulp.task('copy:html', copyTask({
|
gulp.task('copy:html', copyTask({
|
||||||
@ -243,10 +243,10 @@ function createTasksForBuildJsExtension({ buildJsFiles, taskPrefix, devMode, bun
|
|||||||
const nonInpageFiles = buildJsFiles.filter(file => file !== 'inpage')
|
const nonInpageFiles = buildJsFiles.filter(file => file !== 'inpage')
|
||||||
const buildPhase1 = ['inpage']
|
const buildPhase1 = ['inpage']
|
||||||
const buildPhase2 = nonInpageFiles
|
const buildPhase2 = nonInpageFiles
|
||||||
const destinations = browserPlatforms.map(platform => `./dist/${platform}/scripts`)
|
const destinations = browserPlatforms.map(platform => `./dist/${platform}`)
|
||||||
bundleTaskOpts = Object.assign({
|
bundleTaskOpts = Object.assign({
|
||||||
buildSourceMaps: true,
|
buildSourceMaps: true,
|
||||||
sourceMapDir: devMode ? './' : '../../sourcemaps',
|
sourceMapDir: devMode ? './' : '../sourcemaps',
|
||||||
minifyBuild: !devMode,
|
minifyBuild: !devMode,
|
||||||
buildWithFullPaths: devMode,
|
buildWithFullPaths: devMode,
|
||||||
}, bundleTaskOpts)
|
}, bundleTaskOpts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user