Created
January 17, 2023 20:24
-
-
Save rotu/d5fae84ad32b8fe8bddce42d60405456 to your computer and use it in GitHub Desktop.
open window and inject module
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
j = "data:text/javascript,"+encodeURIComponent(`console.log("hello from "+import.meta.url)`) | |
w = window.open("about:blank") | |
x1 = await w.eval(`import(${JSON.stringify(j)})`) | |
x2 = await w.eval(`import(${JSON.stringify(j)})`) | |
w2 = window.open("about:blank") | |
y1 = await w2.eval(`import(${JSON.stringify(j)})`) | |
y2 = await w2.eval(`import(${JSON.stringify(j)})`) | |
console.assert(x1 === x2) | |
console.assert(y1 === y2) | |
console.assert(x1 !== y1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment