nifty-wallet/library/lib/setup-iframe.js

20 lines
543 B
JavaScript
Raw Normal View History

2016-08-26 11:08:23 -07:00
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,
2016-08-26 11:08:23 -07:00
sandboxAttributes: opts.sandboxAttributes || ['allow-scripts', 'allow-popups'],
})
var iframe = frame.iframe
iframe.style.setProperty('display', 'none')
2016-08-26 11:08:23 -07:00
var iframeStream = new IframeStream(iframe)
return iframeStream
}