broulik created this revision. broulik added reviewers: Plasma, fvogt. Herald added a project: Plasma. Herald added a subscriber: plasma-devel. broulik requested review of this revision.
REVISION SUMMARY I don't recall if there was a particular reason for using *before* unload but this event is not emitted for iframes. Using "unload" 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. We did noticed a video in an overlay being removed but not when it was inside of an iframe. TEST PLAN - 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. REPOSITORY R856 Plasma Browser Integration REVISION DETAIL https://phabricator.kde.org/D28926 AFFECTED FILES extension/content-script.js extension/extension-mpris.js To: broulik, #plasma, fvogt Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart