aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-10-26 07:03:48 +0800
committerGitHub <noreply@github.com>2017-10-26 07:03:48 +0800
commit988dd8fd6105dfe869592ad5238b5d1a80bb8435 (patch)
tree6482a1115d0ce3606271e7352f956a26e32e0cb5
parent2489caddd4f42339a98cf0be767ad9cd003ad40c (diff)
parent23daca0e080483dc55bf72448214e75406bcdb67 (diff)
downloadtangerine-wallet-browser-988dd8fd6105dfe869592ad5238b5d1a80bb8435.tar
tangerine-wallet-browser-988dd8fd6105dfe869592ad5238b5d1a80bb8435.tar.gz
tangerine-wallet-browser-988dd8fd6105dfe869592ad5238b5d1a80bb8435.tar.bz2
tangerine-wallet-browser-988dd8fd6105dfe869592ad5238b5d1a80bb8435.tar.lz
tangerine-wallet-browser-988dd8fd6105dfe869592ad5238b5d1a80bb8435.tar.xz
tangerine-wallet-browser-988dd8fd6105dfe869592ad5238b5d1a80bb8435.tar.zst
tangerine-wallet-browser-988dd8fd6105dfe869592ad5238b5d1a80bb8435.zip
Merge pull request #2100 from ChainsawBaby/patch-1
Remove annoying console.log on each run
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/scripts/inpage.js10
2 files changed, 8 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index de43a489c..671bb7a6f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
- Add support for alternative ENS TLDs (Ethereum Name Service Top-Level Domains).
- Lower minimum gas price to 0.1 GWEI.
+- Remove web3 injection message from production (thanks to @ChainsawBaby)
## 3.11.2 2017-10-21
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index 9e98c044b..b6889b00f 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -1,6 +1,7 @@
/*global Web3*/
cleanContextForImports()
require('web3/dist/web3.min.js')
+const log = require('loglevel')
const LocalMessageDuplexStream = require('post-message-stream')
// const PingStream = require('ping-pong-stream/ping')
// const endOfStream = require('end-of-stream')
@@ -8,6 +9,10 @@ const setupDappAutoReload = require('./lib/auto-reload.js')
const MetamaskInpageProvider = require('./lib/inpage-provider.js')
restoreContextAfterImports()
+const METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
+window.log = log
+log.setDefaultLevel(METAMASK_DEBUG ? 'debug' : 'warn')
+
//
// setup plugin communication
@@ -28,9 +33,9 @@ var inpageProvider = new MetamaskInpageProvider(metamaskStream)
var web3 = new Web3(inpageProvider)
web3.setProvider = function () {
- console.log('MetaMask - overrode web3.setProvider')
+ log.debug('MetaMask - overrode web3.setProvider')
}
-console.log('MetaMask - injected web3')
+log.debug('MetaMask - injected web3')
// export global web3, with usage-detection
setupDappAutoReload(web3, inpageProvider.publicConfigStore)
@@ -65,4 +70,3 @@ function restoreContextAfterImports () {
console.warn('MetaMask - global.define could not be overwritten.')
}
}
-