aboutsummaryrefslogtreecommitdiffstats
path: root/mascara
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-04-05 09:23:46 +0800
committerkumavis <aaron@kumavis.me>2017-04-05 09:23:46 +0800
commit5a91adf7d802097805938e3d54fe7256b19724d1 (patch)
tree9ad83ef345650796822b5462cff0d0bf5eab9b22 /mascara
parent5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb (diff)
downloadtangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.gz
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.bz2
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.lz
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.xz
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.zst
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.zip
add platforms to mascara + move buyEther window open to ui
Diffstat (limited to 'mascara')
-rw-r--r--mascara/src/background.js8
-rw-r--r--mascara/src/popup.js5
2 files changed, 12 insertions, 1 deletions
diff --git a/mascara/src/background.js b/mascara/src/background.js
index 6f9fb3d13..957570050 100644
--- a/mascara/src/background.js
+++ b/mascara/src/background.js
@@ -8,6 +8,7 @@ const PortStream = require('../../app/scripts/lib/port-stream.js')
const DbController = require('./lib/index-db-controller')
+const SwPlatform = require('../../app/scripts/platforms/sw')
const MetamaskController = require('../../app/scripts/metamask-controller')
const extension = {} //require('../../app/scripts/lib/extension')
@@ -17,7 +18,8 @@ const migrations = require('../../app/scripts/migrations/')
const firstTimeState = require('../../app/scripts/first-time-state')
const STORAGE_KEY = 'metamask-config'
-const METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
+// const METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
+const METAMASK_DEBUG = true
let popupIsOpen = false
const log = require('loglevel')
@@ -70,7 +72,11 @@ function setupController (initState, client) {
// MetaMask Controller
//
+ const platform = new SwPlatform()
+
const controller = new MetamaskController({
+ // platform specific implementation
+ platform,
// User confirmation callbacks:
showUnconfirmedMessage: noop,
unlockAccountMessage: noop,
diff --git a/mascara/src/popup.js b/mascara/src/popup.js
index ef7759a81..b740e81a5 100644
--- a/mascara/src/popup.js
+++ b/mascara/src/popup.js
@@ -4,8 +4,13 @@ const SwStream = require('sw-stream/lib/sw-stream.js')
const MetaMaskUiCss = require('../../ui/css')
const setupIframe = require('./lib/setup-iframe.js')
const MetamaskInpageProvider = require('../../app/scripts/lib/inpage-provider.js')
+const MetamascaraPlatform = require('../../app/scripts/platforms/window')
const startPopup = require('../../app/scripts/popup-core')
+// create platform global
+global.platform = new MetamascaraPlatform()
+
+
var css = MetaMaskUiCss()
injectCss(css)
const container = document.getElementById('app-content')