I understand what you mean with DOM, that’s why I set “run_at”: “document_idle”
But the problem now is, that I have to refresh YouTube every time I visit it, to enable the AddOn. It means, that YouTube starts automatically with Speed = 1x. And I have to refresh it, to enable speed = 2. I also have to refresh YouTube, to inject the cookies…
So I tried to set “run_at”: “document_start” But that doesn’t work of course, because the DOM isn’t loaded when the Cookie and the JS get injected. So what can I do, that this works automatically without refreshing?
I’m not sure what you mean here and what this cookie is for, but since you cannot know when YouTube scripts actually install the API, the code you inject into the page context should poll for 1/ having an element with id movie_player
and 2/ make sure the YT API is installed by checking the element setPlaybackRate
property.
How can I modify the websites, on which this AddOn runs. So, I don’t want that live-videos play with double speed, because that won’t obviously work. But everything else (setVolume, inject Cookie etc.) should work on live-videos as well. Do I have to create two .js files for that ?
My guess is that if a web site embeds YT videos and you inject your code into the YT iframe, it will work.
Well, this question is actually about YouTube-API. How to change the default quality? I want that it always uses the highest resolution.
document.getElementById(“movie_player”).setPlaybackQuality(‘hd1080’); doesn’t work, also not with the console.
The best is probably to check the YouTube embedding API.