Skip to content

Commit 846894d

Browse files
committed
poc
1 parent 6e6e212 commit 846894d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/core/src/lavadome.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ navigation.addEventListener('navigate', event => {
3131

3232
export function LavaDome(host, opts) {
3333
opts = options(opts);
34-
34+
3535
// make exported API tamper-proof
3636
defineProperties(this, {text: {value: text}});
3737

@@ -41,15 +41,16 @@ export function LavaDome(host, opts) {
4141

4242
// fire every time instance is reloaded and abort loading for non-top documents
4343
const iframe = loadable();
44-
addEventListener(iframe, 'load', () => {
44+
iframe.setAttribute('srcdoc', '<script>frameElement.xxx()</script>');
45+
defineProperties(iframe, { xxx: { value: () => {
4546
const ownerDoc = ownerDocument(iframe);
4647
if (ownerDoc !== document) {
4748
replaceChildren(shadow);
4849
throw new Error(`LavaDomeCore: ` +
4950
`The document to which LavaDome was originally introduced ` +
5051
`must be the same as the one this instance is inserted to`);
51-
}
52-
});
52+
}}}}
53+
);
5354

5455
// child of the shadow, where the secret is set, must be hardened
5556
const child = hardened();

0 commit comments

Comments
 (0)