This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code is assumed to be part of one of the extension's content scripts | |
function addIframe() { | |
const iframe = document.createElement('iframe'); | |
iframe.addEventListener('load', () => { | |
iframe.contentWindow.postMessage({ | |
eventName: 'init', | |
iframeSrc: 'https://xkcd.com/' // whatever url you want. Probably will be a URL to your own domain in practice | |
}, '*'); | |
}, false); |