You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
479 B
19 lines
479 B
8 years ago
|
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
|
||
|
}
|