aboutsummaryrefslogtreecommitdiffstats
path: root/mascara/src/lib/setup-iframe.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2017-04-05 02:27:45 +0800
committerGitHub <noreply@github.com>2017-04-05 02:27:45 +0800
commit5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb (patch)
tree38c3fac654c41df24f01b6de3aa453d68b259c07 /mascara/src/lib/setup-iframe.js
parent39181ed33f1b9829f82c44d2f21e2f3ab1d1c979 (diff)
parent4779999bfc7e03eedf3fd2702f7f448d751218f8 (diff)
downloadtangerine-wallet-browser-5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb.tar
tangerine-wallet-browser-5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb.tar.gz
tangerine-wallet-browser-5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb.tar.bz2
tangerine-wallet-browser-5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb.tar.lz
tangerine-wallet-browser-5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb.tar.xz
tangerine-wallet-browser-5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb.tar.zst
tangerine-wallet-browser-5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb.zip
Merge pull request #1307 from MetaMask/mascara
Proof of Concept: Mascara
Diffstat (limited to 'mascara/src/lib/setup-iframe.js')
-rw-r--r--mascara/src/lib/setup-iframe.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/mascara/src/lib/setup-iframe.js b/mascara/src/lib/setup-iframe.js
new file mode 100644
index 000000000..db67163df
--- /dev/null
+++ b/mascara/src/lib/setup-iframe.js
@@ -0,0 +1,19 @@
+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
+}