Skip to content

Commit a4bbe1c

Browse files
authored
fix: add unload handler to prevent bfcache [LW-13213] (#1935)
bfcache appears to break extension messaging
1 parent 9ce4055 commit a4bbe1c

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

apps/browser-extension-wallet/src/assets/html/load-app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ window.addEventListener(
77
},
88
{ once: true }
99
);
10+
11+
// this should prevent https://web.dev/articles/bfcache
12+
window.onunload = () => {
13+
console.log('unload');
14+
};

apps/browser-extension-wallet/src/assets/html/load-dapp-connector.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ window.addEventListener(
77
},
88
{ once: true }
99
);
10+
11+
// this should prevent https://web.dev/articles/bfcache
12+
window.onunload = () => {
13+
console.log('unload');
14+
};

apps/browser-extension-wallet/src/assets/html/load-popup.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ window.addEventListener(
77
},
88
{ once: true }
99
);
10+
11+
// this should prevent https://web.dev/articles/bfcache
12+
window.onunload = () => {
13+
console.log('unload');
14+
};

0 commit comments

Comments
 (0)