Skip to content

Instantly share code, notes, and snippets.

@mstewartgallus
Created January 12, 2023 16:51
Show Gist options
  • Save mstewartgallus/d34beaebcc79a39b873cb85b69b0a0e3 to your computer and use it in GitHub Desktop.
Save mstewartgallus/d34beaebcc79a39b873cb85b69b0a0e3 to your computer and use it in GitHub Desktop.
You can actually replace the current page with a blob. However, this page as a blob has very limited permissions.
document.location.replace(URL.createObjectURL(new Blob([`<!DOCTYPE html>
<html>
<head>
<title>Lol</title>
<script>
history.replaceState(null, null, "lol");
</script>
</head>
<body>
lol lmao
</body>
</html>
`], { type: 'text/html' })));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment