<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<script> | |
self.addEventListener('error', evt => { | |
self.parent.postMessage({ type: 'ErrorEvent', msg: evt.message }, '*'); | |
}); | |
const el = document.createElement('script'); | |
const params = new URLSearchParams(self.location.search); | |
el.src = params.get('script'); | |
el.addEventListener('load', evt => { | |
runScript(); | |
}); | |
document.body.appendChild(el); | |
</script> | |
</body> | |
</html> |