Turns out we're not the only script that messes with the top of the DOM,
and because we're in a separate context, we're potentially doing it in
parallel.
This moves injection into the found video node
fvogt |
Turns out we're not the only script that messes with the top of the DOM,
and because we're in a separate context, we're potentially doing it in
parallel.
This moves injection into the found video node
Ran media sessions example
No Linters Available |
No Unit Test Coverage |
Buildable 132 | |
Build 132: arc lint + arc unit |
Media sessions doesn't necessarily need a player item, it's basically meant for when you don't have one. The website might remove the player item when it pauses when it's using media sessions API to do custom handling. Can't think of a better solution, though.
Also, executeScript is used not only for this, is it?
I don't think this is a good idea - if no player exists, it'll either fail silently or throw an exception on the "element.parentNode" access.
Right, I should move the removeChild to before the break.
As for the other comment if there's no players, there's limited point executing the script.