I don't recall if there was a particular reason for using *before* unload but this event is not emitted for iframes.
Using "pagehide" instead makes an iframe content script notice it's being destroyed (e.g. because of the overlay it was in being removed) and correctly signals the player being gone. "unload" supposedly causes the browser trouble caching the page.
We did noticed a video in an overlay being removed but not when it was inside of an iframe.
Details
Details
- Reviewers
fvogt ognarb - Group Reviewers
Plasma - Commits
- R856:229a5e2c9565: Signal player gone in "pagehide" not "beforeunload"
- media controller hides when closing YouTube videos in overlays on websites, e.g. https://www.winhistory.de/more/nt31.htm
- media controller hides when closing a video on tweetdeck.
- normally navigating away from a video (not in an iframe) still signals gone
Diff Detail
Diff Detail
- Repository
- R856 Plasma Browser Integration
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.