aboutsummaryrefslogtreecommitdiffstats
path: root/library/lib
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2017-04-03 13:01:44 +0800
committerfrankiebee <frankie.diamond@gmail.com>2017-04-03 13:01:44 +0800
commit8d49d519c090d287484008346aba1df6d7ad77e7 (patch)
treea4064ac0a05429c591e6776bf496c803d1819ae9 /library/lib
parent29a602a89b176e7af3f15297c2f586a4ece0a726 (diff)
downloadtangerine-wallet-browser-8d49d519c090d287484008346aba1df6d7ad77e7.tar.gz
tangerine-wallet-browser-8d49d519c090d287484008346aba1df6d7ad77e7.tar.zst
tangerine-wallet-browser-8d49d519c090d287484008346aba1df6d7ad77e7.zip
Rename and move around files
Diffstat (limited to 'library/lib')
-rw-r--r--library/lib/setup-iframe.js19
-rw-r--r--library/lib/setup-provider.js22
-rw-r--r--library/lib/setup-untrusted-connection.js27
3 files changed, 0 insertions, 68 deletions
diff --git a/library/lib/setup-iframe.js b/library/lib/setup-iframe.js
deleted file mode 100644
index db67163df..000000000
--- a/library/lib/setup-iframe.js
+++ /dev/null
@@ -1,19 +0,0 @@
-const Iframe = require('iframe')
-const IframeStream = require('iframe-stream').IframeStream
-
-module.exports = setupIframe
-
-
-function setupIframe(opts) {
- opts = opts || {}
- var frame = Iframe({
- src: opts.zeroClientProvider || 'https://zero.metamask.io/',
- container: opts.container || document.head,
- sandboxAttributes: opts.sandboxAttributes || ['allow-scripts', 'allow-popups'],
- })
- var iframe = frame.iframe
- iframe.style.setProperty('display', 'none')
- var iframeStream = new IframeStream(iframe)
-
- return iframeStream
-}
diff --git a/library/lib/setup-provider.js b/library/lib/setup-provider.js
deleted file mode 100644
index 1b53e7f54..000000000
--- a/library/lib/setup-provider.js
+++ /dev/null
@@ -1,22 +0,0 @@
-const setupIframe = require('./setup-iframe.js')
-const MetamaskInpageProvider = require('../../app/scripts/lib/inpage-provider.js')
-
-module.exports = getProvider
-
-
-function getProvider(){
- if (global.web3) {
- console.log('MetaMask ZeroClient - using environmental web3 provider')
- return global.web3.currentProvider
- }
- console.log('MetaMask ZeroClient - injecting zero-client iframe!')
- var iframeStream = setupIframe({
- zeroClientProvider: 'http://localhost:9001',
- sandboxAttributes: ['allow-scripts', 'allow-popups', 'allow-same-origin'],
- container: document.body,
- })
-
- var inpageProvider = new MetamaskInpageProvider(iframeStream)
- return inpageProvider
-
-}
diff --git a/library/lib/setup-untrusted-connection.js b/library/lib/setup-untrusted-connection.js
deleted file mode 100644
index b2aeb7905..000000000
--- a/library/lib/setup-untrusted-connection.js
+++ /dev/null
@@ -1,27 +0,0 @@
-
-/*
-IFRAME
- var pageStream = new LocalMessageDuplexStream({
- name: 'contentscript',
- target: 'inpage',
- })
-SERVICEWORKER
- pageStream.on('error', console.error)
- var pluginPort = extension.runtime.connect({name: 'contentscript'})
- var pluginStream = new PortStream(pluginPort)
- pluginStream.on('error', console.error)
-IFRAME --> SW
- // forward communication plugin->inpage
- pageStream.pipe(pluginStream).pipe(pageStream)
-*/
-
-module.exports = SetupUntrustedComunicationWithSW
-
-function SetupUntrustedComunicationWithSW (connectionStream, readySwStream) {
- pageStream.on('error', console.error)
- var pluginPort = extension.runtime.connect({name: 'contentscript'})
- var pluginStream = new PortStream(pluginPort)
- pluginStream.on('error', console.error)
- // forward communication plugin->inpage
- pageStream.pipe(pluginStream).pipe(pageStream)
-}