Last active
May 10, 2019 15:32
-
-
Save hemanth/ebb6a2e01f10c515162b4af7efd91474 to your computer and use it in GitHub Desktop.
Portal W3C test
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> | |
<body> | |
<h1>Main</h1> | |
<button>Load portal</button> | |
</body> | |
<script> | |
document.querySelector('button').addEventListener('click', () => { | |
const portal = document.createElement('portal'); | |
portal.src = 'http://localhost:3001'; | |
document.body.appendChild(portal); | |
portal.activate(); | |
}); | |
</script> | |
</html> |
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> | |
<body> | |
<h1>Portal</h1> | |
</body> | |
<script> | |
window.addEventListener('portalactivate', (evt) => { | |
alert("here") | |
console.log({ | |
adoptPredecessor: evt.adoptPredecessor() | |
}) | |
}); | |
</script> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment