aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-08-30 09:27:55 +0800
committerGitHub <noreply@github.com>2016-08-30 09:27:55 +0800
commit791e80988d889a72fee12579fa6525b6b0f15e18 (patch)
treededc156a42acb9419a7eba8decbcad98cc9cb59a /app
parenta9c738d4d3226f61942641a41c399c75a3e9eb3e (diff)
parentc15eef9425531c86a9016d1cbad9d32f4d12edcd (diff)
downloadtangerine-wallet-browser-791e80988d889a72fee12579fa6525b6b0f15e18.tar
tangerine-wallet-browser-791e80988d889a72fee12579fa6525b6b0f15e18.tar.gz
tangerine-wallet-browser-791e80988d889a72fee12579fa6525b6b0f15e18.tar.bz2
tangerine-wallet-browser-791e80988d889a72fee12579fa6525b6b0f15e18.tar.lz
tangerine-wallet-browser-791e80988d889a72fee12579fa6525b6b0f15e18.tar.xz
tangerine-wallet-browser-791e80988d889a72fee12579fa6525b6b0f15e18.tar.zst
tangerine-wallet-browser-791e80988d889a72fee12579fa6525b6b0f15e18.zip
Merge pull request #596 from MetaMask/EdgeCompatibility
Edge compatibility
Diffstat (limited to 'app')
-rw-r--r--app/manifest.json4
-rw-r--r--app/scripts/chromereload.js6
-rw-r--r--app/scripts/contentscript.js8
-rw-r--r--app/scripts/lib/extension-instance.js15
-rw-r--r--app/scripts/lib/notifications.js3
-rw-r--r--app/scripts/popup.js10
6 files changed, 25 insertions, 21 deletions
diff --git a/app/manifest.json b/app/manifest.json
index 32b7d189e..5444007fa 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -3,6 +3,7 @@
"short_name": "Metamask",
"version": "2.10.0",
"manifest_version": 2,
+ "author": "https://metamask.io",
"description": "Ethereum Browser Extension",
"commands": {
"_execute_browser_action": {
@@ -28,7 +29,8 @@
"scripts": [
"scripts/chromereload.js",
"scripts/background.js"
- ]
+ ],
+ "persistent": true
},
"browser_action": {
"default_icon": {
diff --git a/app/scripts/chromereload.js b/app/scripts/chromereload.js
index 88333ba8a..f0bae403c 100644
--- a/app/scripts/chromereload.js
+++ b/app/scripts/chromereload.js
@@ -324,13 +324,13 @@ window.LiveReloadOptions = { host: 'localhost' };
this.pluginIdentifiers = {}
this.console = this.window.console && this.window.console.log && this.window.console.error ? this.window.location.href.match(/LR-verbose/) ? this.window.console : {
log: function () {},
- error: this.window.console.error.bind(this.window.console),
+ error: console.error,
} : {
log: function () {},
error: function () {},
}
if (!(this.WebSocket = this.window.WebSocket || this.window.MozWebSocket)) {
- this.console.error('LiveReload disabled because the browser does not seem to support web sockets')
+ console.error('LiveReload disabled because the browser does not seem to support web sockets')
return
}
if ('LiveReloadOptions' in window) {
@@ -344,7 +344,7 @@ window.LiveReloadOptions = { host: 'localhost' };
} else {
this.options = Options.extract(this.window.document)
if (!this.options) {
- this.console.error('LiveReload disabled because it could not find its own <SCRIPT> tag')
+ console.error('LiveReload disabled because it could not find its own <SCRIPT> tag')
return
}
}
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js
index de2cf263b..b3a560c88 100644
--- a/app/scripts/contentscript.js
+++ b/app/scripts/contentscript.js
@@ -43,20 +43,20 @@ function setupStreams(){
name: 'contentscript',
target: 'inpage',
})
- pageStream.on('error', console.error.bind(console))
+ pageStream.on('error', console.error)
var pluginPort = extension.runtime.connect({name: 'contentscript'})
var pluginStream = new PortStream(pluginPort)
- pluginStream.on('error', console.error.bind(console))
+ pluginStream.on('error', console.error)
// forward communication plugin->inpage
pageStream.pipe(pluginStream).pipe(pageStream)
// connect contentscript->inpage reload stream
var mx = ObjectMultiplex()
- mx.on('error', console.error.bind(console))
+ mx.on('error', console.error)
mx.pipe(pageStream)
var reloadStream = mx.createStream('reload')
- reloadStream.on('error', console.error.bind(console))
+ reloadStream.on('error', console.error)
// if we lose connection with the plugin, trigger tab refresh
pluginStream.on('close', function () {
diff --git a/app/scripts/lib/extension-instance.js b/app/scripts/lib/extension-instance.js
index 1098130e3..628b62e3f 100644
--- a/app/scripts/lib/extension-instance.js
+++ b/app/scripts/lib/extension-instance.js
@@ -46,12 +46,23 @@ function Extension () {
_this[api] = browser[api]
}
} catch (e) {}
-
try {
_this.api = browser.extension[api]
} catch (e) {}
-
})
+
+ try {
+ if (browser && browser.runtime) {
+ this.runtime = browser.runtime
+ }
+ } catch (e) {}
+
+ try {
+ if (browser && browser.browserAction) {
+ this.browserAction = browser.browserAction
+ }
+ } catch (e) {}
+
}
module.exports = Extension
diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js
index dcb946845..432ad0445 100644
--- a/app/scripts/lib/notifications.js
+++ b/app/scripts/lib/notifications.js
@@ -14,9 +14,10 @@ function show () {
return extension.windows.update(popup.id, { focused: true })
}
+
extension.windows.create({
url: 'notification.html',
- type: 'detached_panel',
+ type: 'popup',
focused: true,
width: 360,
height: 500,
diff --git a/app/scripts/popup.js b/app/scripts/popup.js
index 90b90a7af..096b56115 100644
--- a/app/scripts/popup.js
+++ b/app/scripts/popup.js
@@ -74,22 +74,12 @@ function getCurrentDomain (cb) {
})
}
-function clearNotifications(){
- extension.notifications.getAll(function (object) {
- for (let notification in object){
- extension.notifications.clear(notification)
- }
- })
-}
-
function setupApp (err, opts) {
if (err) {
alert(err.stack)
throw err
}
- clearNotifications()
-
var container = document.getElementById('app-content')
MetaMaskUi({