mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 21:00:13 +01:00
20 lines
543 B
JavaScript
20 lines
543 B
JavaScript
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
|
|
}
|