Created
March 21, 2021 04:06
-
-
Save tamzidoronno/9b49c81a23661ff40471cfce433528dc to your computer and use it in GitHub Desktop.
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"> | |
<title></title> | |
</head> | |
<body> | |
<h1>Receiver html</h1> | |
</body> | |
<script> | |
const ADMIN_FRONTEND_DOMAIN = `http://localhost:8081`; // TO_EDIT_THIS_PLACE | |
window.addEventListener('message',function(event) { | |
if(event.origin !== ADMIN_FRONTEND_DOMAIN) { | |
return; | |
} | |
const data = event.data; | |
for (key in data) { | |
localStorage.setItem(key, data[key]); | |
} | |
},false); | |
localStorage.setItem("lastname", "Smith"); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment