lawrencehook / remove-youtube-suggestions

A browser extension that removes YouTube suggestions, comments, shorts, and more
https://lawrencehook.com/rys/
Mozilla Public License 2.0
401 stars 33 forks source link

Add an option to automatically disable AutoPlay #33

Closed lawrencehook closed 2 years ago

ubaifadhli commented 2 years ago

I'm still inexperienced with CSS selector nor JS, but I think this can be achieved by :

What do you think? I can try creating a pull request if this is an okay idea.

lawrencehook commented 2 years ago

Thanks for investigating! Feel free to give it a shot if you'd like. Head's up I agree that it might be a bit tricky because this option will be different from the existing ones because of the JavaScript involved.

lawrencehook commented 2 years ago

Possible approach: add a mutation observer and click on the result of document.querySelectorAll(".ytp-autonav-toggle-button[aria-checked='true']") if it exists.

lawrencehook commented 2 years ago
Array.from(document.querySelectorAll(".ytp-autonav-toggle-button[aria-checked='true']")).forEach(e => e.click())
lawrencehook commented 2 years ago

done as of 402d6cab25ca3c76dcafbcbd074cfda4d1c050ed