Also intercept creation of video elements
ClosedPublic

Authored by broulik on Jul 4 2018, 8:34 AM.

Details

Summary

Spotify web player uses a video tag instead of audio to play its music.
Also remove the element after adding it. This ensures the element returned to the caller is not part of the DOM but it is sufficient for our MutationObserver to see it and keep a reference to it in order to control it.

BUG: 395379

Test Plan

I can control Spotify Web player now.

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.
broulik created this revision.Jul 4 2018, 8:34 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 4 2018, 8:34 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Jul 4 2018, 8:34 AM
davidedmundson accepted this revision.Jul 4 2018, 9:51 AM
This revision is now accepted and ready to land.Jul 4 2018, 9:51 AM
broulik planned changes to this revision.Jul 4 2018, 10:26 AM

it seems the video tags accumulate in the DOM, sometimes it creates a new player when playing a new song. Also it seems to break YouTube first opening. ..

broulik updated this revision to Diff 37139.Jul 4 2018, 12:24 PM
broulik edited the summary of this revision. (Show Details)
broulik edited the test plan for this revision. (Show Details)
  • Remove child right after adding it, fixes YouTube and other video player breakage, also avoids leaking those DOM elements in the head element
This revision is now accepted and ready to land.Jul 4 2018, 12:24 PM
This revision was automatically updated to reflect the committed changes.