run in parent

by frumbert

JavaScript

const target = window.parent.document;

let script = target.createElement('script');
script.textContent = `
var foo = 'the quick brown fox';

function run() {
	let output = foo.replace(/\s/g,'_');
  document.querySelector('output').textContent = output;
}
`;
target.head.appendChild(script);