File tree Expand file tree Collapse file tree
src/plugins/youtube-music-background-play Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,11 +67,22 @@ export function nonStop() {
6767 }
6868
6969 // console.log('[Youtube Music] Setting up observer for video element')
70- observe ( document . documentElement , 'video' , {
71- onMatch ( [ video ] ) {
72- if ( video instanceof HTMLVideoElement ) {
73- watchMediaElement ( video )
74- }
70+ observe (
71+ document . documentElement ,
72+ 'video,ytmusic-you-there-renderer:not([aria-hidden="true"]) button[aria-label="Yes"]' ,
73+ {
74+ onMatch ( [ element ] ) {
75+ if ( element instanceof HTMLVideoElement ) {
76+ watchMediaElement ( element )
77+ }
78+ if ( element instanceof HTMLButtonElement ) {
79+ console . log ( 'Auto-closing "Are you there?" dialog via observer' )
80+ setTimeout ( ( ) => {
81+ element . click ( )
82+ console . log ( 'Clicked "Yes" button' )
83+ } , 100 )
84+ }
85+ } ,
7586 } ,
76- } )
87+ )
7788}
You can’t perform that action at this time.
0 commit comments