blob: 2654a2a50405b5184453b23da75a58d06c1943b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<!doctype html>
<html>
<iframe src="{{GET[childsrc]}}">
</iframe>
<script>
const frame = document.getElementsByTagName('iframe')[0];
const reply = op => window.parent.postMessage('DONE ' + op, '*');
window.onmessage = e => {
switch (e.data) {
case 'REMOVE FRAME':
frame.remove();
reply(e.data);
break;
case 'NAVIGATE FRAME':
frame.srcdoc = '<html></html>';
frame.onload = () => reply(e.data);
break;
}
};
</script>
</html>
|