Commit e77c0489 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Also intercept creation of video elements

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.

Differential Revision:
parent 114a1aa9
......@@ -502,8 +502,11 @@ function loadMediaSessionsShim() {
var tagName = arguments[0];
if (typeof tagName === "string" && tagName.toLowerCase() === "audio") {
(document.head || document.documentElement).appendChild(createdTag);
if (typeof tagName === "string") {
if (tagName.toLowerCase() === "audio" || tagName.toLowerCase() === "video") {
(document.head || document.documentElement).appendChild(createdTag);
return createdTag;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment