diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-08-12 13:43:41 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-08-12 13:43:41 +0800 |
commit | 8f9a0a535cbe904b0816c954c170c71843f62da9 (patch) | |
tree | f5a71b1a663b3b2497a31e8d5f30f54f10a9c0c9 /app | |
parent | 0b9b892c6b27c55a016378387cb8d227957f8528 (diff) | |
download | tangerine-wallet-browser-8f9a0a535cbe904b0816c954c170c71843f62da9.tar tangerine-wallet-browser-8f9a0a535cbe904b0816c954c170c71843f62da9.tar.gz tangerine-wallet-browser-8f9a0a535cbe904b0816c954c170c71843f62da9.tar.bz2 tangerine-wallet-browser-8f9a0a535cbe904b0816c954c170c71843f62da9.tar.lz tangerine-wallet-browser-8f9a0a535cbe904b0816c954c170c71843f62da9.tar.xz tangerine-wallet-browser-8f9a0a535cbe904b0816c954c170c71843f62da9.tar.zst tangerine-wallet-browser-8f9a0a535cbe904b0816c954c170c71843f62da9.zip |
clean up
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/background.js | 3 | ||||
-rw-r--r-- | app/scripts/contentscript.js | 2 | ||||
-rw-r--r-- | app/scripts/lib/createLoggerMiddleware.js | 2 | ||||
-rw-r--r-- | app/scripts/lib/setupLedgerIframe.js | 40 |
4 files changed, 4 insertions, 43 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js index bff559469..3d3afdd4e 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -68,6 +68,8 @@ initialize().catch(log.error) // setup metamask mesh testing container setupMetamaskMeshMetrics() + + /** * An object representing a transaction, in whatever state it is in. * @typedef TransactionMeta @@ -444,4 +446,3 @@ extension.runtime.onInstalled.addListener(function (details) { extension.tabs.create({url: 'https://metamask.io/#how-it-works'}) } }) - diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 01df9e327..e0a2b0061 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -200,4 +200,4 @@ function redirectToPhishingWarning () { console.log('MetaMask - routing to Phishing Warning component') const extensionURL = extension.runtime.getURL('phishing.html') window.location.href = extensionURL -}
\ No newline at end of file +} diff --git a/app/scripts/lib/createLoggerMiddleware.js b/app/scripts/lib/createLoggerMiddleware.js index 53913921c..996c3477c 100644 --- a/app/scripts/lib/createLoggerMiddleware.js +++ b/app/scripts/lib/createLoggerMiddleware.js @@ -14,7 +14,7 @@ function createLoggerMiddleware (opts) { log.error('Error in RPC response:\n', res) } if (req.isMetamaskInternal) return - //log.info(`RPC (${opts.origin}):`, req, '->', res) + log.info(`RPC (${opts.origin}):`, req, '->', res) cb() }) } diff --git a/app/scripts/lib/setupLedgerIframe.js b/app/scripts/lib/setupLedgerIframe.js deleted file mode 100644 index 2831d072e..000000000 --- a/app/scripts/lib/setupLedgerIframe.js +++ /dev/null @@ -1,40 +0,0 @@ -const extension = require('extensionizer') -module.exports = setupLedgerIframe -/** - * Injects an iframe into the current document to - * enable the interaction with ledger devices - */ -function setupLedgerIframe () { - const ORIGIN = 'http://localhost:9000' - const ledgerIframe = document.createElement('iframe') - ledgerIframe.src = ORIGIN - console.log('Injecting ledger iframe') - document.head.appendChild(ledgerIframe) - - console.log('[LEDGER]: LEDGER BG LISTENER READY') - extension.runtime.onMessage.addListener(({action, params}) => { - console.log('[LEDGER]: GOT MSG FROM THE KEYRING', action, params) - if (action.search('ledger-') !== -1) { - //Forward messages from the keyring to the iframe - sendMessage({action, params}) - } - }) - - function sendMessage(msg) { - ledgerIframe.contentWindow.postMessage({...msg, target: 'LEDGER-IFRAME'}, '*') - } - - /* - Passing messages from iframe to background script - */ - console.log('[LEDGER]: LEDGER FROM-IFRAME LISTENER READY') - window.addEventListener('message', event => { - if(event.origin !== ORIGIN) return false - if (event.data && event.data.action && event.data.action.search('ledger-') !== -1) { - // Forward messages from the iframe to the keyring - console.log('[LEDGER] : forwarding msg', event.data) - extension.runtime.sendMessage(event.data) - } - }) - - }
\ No newline at end of file |