Greasy Fork is available in English.

Youtube - dismiss sign-in

Hide the "sign-in" and cookies dialogs. Prevent the dialogs from pausing the video.

< Feedback on Youtube - dismiss sign-in

Review: Good - script works

§
Posted: 2020.11.12.

Thanks a lot,
I can use Youtube again. Just hiding pop-pup stop auto-play :(
I don't understand all the script but for Firefox 66.0.3 no problem.

AchernarAuthor
§
Posted: 2020.11.12.
Edited: 2020.11.12.

The script works in 2 parts.

The first part puts code in place to handle the 2 popups (plus 2 smaller ones). This is where the "MutationObserver" are used. They watch for modifications in the html code of the page. No all "MutationObserver" are used. It depends on how the HTML is structured at the time the userscript is executed.

There is style injection to hide these popups when they are displayed and while the script "clicks" on "dismiss" on your behalf.
The 3 lines starting with var s=document.createElement('style');

The second part is to prevent the popups from pausing or stopping the video.
It starts with the line s=document.createElement('script');

This script is injected inside the page to work closely with the code of the page.
The f() function is the part waiting for the element with the player API. Once it appears in the page, it parses the name of all its functions looking for 'cancelPlayback', 'pauseVideo', 'stopVideo', 'playVideo'. It replaces the original with its own function, which checks if the caller is part of the code that opens the popup. If this is the case, it doesn't call the original function, thus preventing pausing stopping...

§
Posted: 2020.11.16.

A big thanks for this :), for others things I am going to be able do this myself.

Post reply

Sign in to post a reply.