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

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: https://phabricator.kde.org/D13878
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);
createdTag.parentNode.removeChild(createdTag);
}
}
return createdTag;
......
Supports Markdown
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