insin / control-panel-for-youtube

Browser extension which gives you more control over YouTube by adding missing options and UI improvements - for desktop & mobile browsers
https://jbscript.dev/control-panel-for-youtube
87 stars 2 forks source link

YouTube has started detecting when we automatically skip ads #51

Open insin opened 3 months ago

insin commented 3 months ago

Might need to mix it up a bit

insin commented 3 months ago

Default view (non-Theater)

The "Ad blockers violate YouTube's Terms of Service" overlay is displayed here

firefox_617QnUPXfj

The player is hidden by this rule:

firefox_1SWEJQgjB7

The video itself is hidden by moving it off-screen using top:

Cui60A09DD

If we…

  1. Hide #error-screen when it contains ytd-enforcement-message-view-model
  2. Make #movie_player visible
  3. Move video back into view by setting top: 0 and click it

…the video will start playing.

While testing these steps manually, it took multiple clicks for the video to successfully play.

This is what's happening to the DOM when I click on the video 3 times with the following styles applied:

ytd-watch-flexy[player-unavailable] #error-screen:has(ytd-enforcement-message-view-model) {
  display: none;
}
ytd-watch-flexy[player-unavailable]:has(#error-screen ytd-enforcement-message-view-model) #player-container-outer.ytd-watch-flexy {
  visibility: visible;
}
ytd-watch-flexy[player-unavailable]:has(#error-screen ytd-enforcement-message-view-model) #movie_player video {
  top: 0 !important;
}

https://github.com/user-attachments/assets/9a79009e-fcbd-4519-8e0f-eede7e929fd7

insin commented 3 months ago

Theater mode

image

The player itself isn't hidden in theater mode, but the video is still positioned off-screen

image

Showing and clicking the video element still eventually forces it to play (took me 5 clicks on the first attempt)