aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-09-13 15:31:04 +0800
committerkumavis <aaron@kumavis.me>2016-09-13 15:31:04 +0800
commita4cdd198438816b99630adf7c30d28a8ec2a18bb (patch)
treeafbf1d4de7020f4a60a6f3923a3352e5db44dfae
parentb4e3b83f0467ebd1610c18d318b5d1b54d8863bb (diff)
downloadtangerine-wallet-browser-a4cdd198438816b99630adf7c30d28a8ec2a18bb.tar
tangerine-wallet-browser-a4cdd198438816b99630adf7c30d28a8ec2a18bb.tar.gz
tangerine-wallet-browser-a4cdd198438816b99630adf7c30d28a8ec2a18bb.tar.bz2
tangerine-wallet-browser-a4cdd198438816b99630adf7c30d28a8ec2a18bb.tar.lz
tangerine-wallet-browser-a4cdd198438816b99630adf7c30d28a8ec2a18bb.tar.xz
tangerine-wallet-browser-a4cdd198438816b99630adf7c30d28a8ec2a18bb.tar.zst
tangerine-wallet-browser-a4cdd198438816b99630adf7c30d28a8ec2a18bb.zip
mascara - everything but the popup bundle
-rw-r--r--app/scripts/popup.js2
-rw-r--r--library/index.js2
-rw-r--r--library/popup.js19
-rw-r--r--library/server.js10
4 files changed, 29 insertions, 4 deletions
diff --git a/app/scripts/popup.js b/app/scripts/popup.js
index 8485b5081..e6f149f96 100644
--- a/app/scripts/popup.js
+++ b/app/scripts/popup.js
@@ -1,7 +1,7 @@
const injectCss = require('inject-css')
const MetaMaskUiCss = require('../../ui/css')
-const PortStream = require('./lib/port-stream.js')
const startPopup = require('./popup-core')
+const PortStream = require('./lib/port-stream.js')
const isPopupOrNotification = require('./lib/is-popup-or-notification')
const extension = require('./lib/extension')
const notification = require('./lib/notifications')
diff --git a/library/index.js b/library/index.js
index 6e43181c9..ded588967 100644
--- a/library/index.js
+++ b/library/index.js
@@ -27,7 +27,7 @@ var shouldPop = false
window.addEventListener('click', function(){
if (!shouldPop) return
shouldPop = false
- window.open('popup.html', '', 'width=1000')
+ window.open('http://localhost:9001/popup/popup.html', '', 'width=1000')
console.log('opening window...')
})
diff --git a/library/popup.js b/library/popup.js
new file mode 100644
index 000000000..667b13371
--- /dev/null
+++ b/library/popup.js
@@ -0,0 +1,19 @@
+const injectCss = require('inject-css')
+const MetaMaskUiCss = require('../ui/css')
+const startPopup = require('../app/scripts/popup-core')
+const setupIframe = require('./lib/setup-iframe.js')
+
+
+var css = MetaMaskUiCss()
+injectCss(css)
+
+var name = 'popup'
+window.METAMASK_UI_TYPE = name
+
+var iframeStream = setupIframe({
+ zeroClientProvider: 'http://127.0.0.1:9001',
+ sandboxAttributes: ['allow-scripts', 'allow-popups', 'allow-same-origin'],
+ container: document.body,
+})
+
+startPopup(iframeStream)
diff --git a/library/server.js b/library/server.js
index 495aba914..033c65358 100644
--- a/library/server.js
+++ b/library/server.js
@@ -6,6 +6,7 @@ const path = require('path')
const zeroBundle = createBundle('./index.js')
const controllerBundle = createBundle('./controller.js')
+// const popupBundle = createBundle('./popup.js')
const appBundle = createBundle('./example/index.js')
//
@@ -14,6 +15,12 @@ const appBundle = createBundle('./example/index.js')
const iframeServer = express()
+// serve popup window
+// iframeServer.get('/popup/scripts/popup.js', function(req, res){
+// res.send(popupBundle.latest)
+// })
+iframeServer.use('/popup', express.static('../dist/chrome'))
+
// serve controller bundle
iframeServer.get('/controller.js', function(req, res){
res.send(controllerBundle.latest)
@@ -21,8 +28,7 @@ iframeServer.get('/controller.js', function(req, res){
// serve background controller
iframeServer.use(express.static('./server'))
-// serve popup window
-// iframeServer.use('/popup', express.static('../dist/chrome'))
+
iframeServer.listen('9001')