Skip to content

Disconnect cross frame api on BFCache page restore#2216

Merged
Kuuuube merged 1 commit intoyomidevs:masterfrom
Kuuuube:fix-bfcache
Oct 21, 2025
Merged

Disconnect cross frame api on BFCache page restore#2216
Kuuuube merged 1 commit intoyomidevs:masterfrom
Kuuuube:fix-bfcache

Conversation

@Kuuuube
Copy link
Copy Markdown
Member

@Kuuuube Kuuuube commented Oct 21, 2025

Fixes #2189

Chrome BFCache changes now break the port connections forcefully and Yomitan ends up unaware of this thinking the connection is just timing out and not disconnected. https://developer.chrome.com/blog/bfcache-extension-messaging-changes

Very similar implementation to the example from the chrome dev blog. Persisted must be checked for to only disconnect when the page is pulled from cache and avoid unnecessary disconnects.

Tested on Firefox as well. Appears to not cause any issues.

@Kuuuube Kuuuube requested a review from a team as a code owner October 21, 2025 16:16
@Kuuuube Kuuuube added kind/bug The issue or PR is regarding a bug browser/chrome The issue is Chrome-only area/api The issue or PR is related to API between Yomitan and other scripts or applications browser/edge The issue is Edge-only labels Oct 21, 2025
@djahandarie
Copy link
Copy Markdown
Collaborator

Side note, I wonder what happens to my crazy postMessage-based channels in this case...

@Kuuuube
Copy link
Copy Markdown
Member Author

Kuuuube commented Oct 21, 2025

displayPopupMessage1 seems to take the fall and blow everything up first in this case.

@Kuuuube Kuuuube added this pull request to the merge queue Oct 21, 2025
Merged via the queue into yomidevs:master with commit 029ebc8 Oct 21, 2025
25 checks passed
@Kuuuube Kuuuube deleted the fix-bfcache branch October 21, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api The issue or PR is related to API between Yomitan and other scripts or applications browser/chrome The issue is Chrome-only browser/edge The issue is Edge-only kind/bug The issue or PR is regarding a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Same word shown for every word I try to scan when returning to site

2 participants