diff options
Diffstat (limited to 'library/lib/setup-iframe.js')
-rw-r--r-- | library/lib/setup-iframe.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/library/lib/setup-iframe.js b/library/lib/setup-iframe.js new file mode 100644 index 000000000..dfb51c676 --- /dev/null +++ b/library/lib/setup-iframe.js @@ -0,0 +1,18 @@ +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: document.head, + sandboxAttributes: opts.sandboxAttributes || ['allow-scripts', 'allow-popups'], + }) + var iframe = frame.iframe + var iframeStream = new IframeStream(iframe) + + return iframeStream +} |