@@ -136,11 +136,16 @@ function importBetaPlayer(ready = false) {
136136 setTimeout ( ( ) => importBetaPlayer ( ! ! videoPlayer ) , 100 ) ;
137137 return ;
138138 }
139+ var lastWatchedPlayer = query ( '#frame' ) ;
140+ if ( query ( '.video-player' ) && lastWatchedPlayer )
141+ lastWatchedPlayer . parentNode . removeChild ( lastWatchedPlayer ) ;
139142
140143 console . log ( "[CR Beta] Removendo player da Crunchyroll..." ) ;
141- remove ( '.video-player-placeholder' , 'Video Placeholder' )
144+ remove ( '.video-player-placeholder' , 'Video Placeholder' ) ;
145+ remove ( '.video-player' , 'Video Player' , true ) ;
146+ remove ( '.blocked-stream-overlay' , 'Blocked Overlay' , true ) ;
147+ videoPlayer . src = '' ;
142148 const appendTo = videoPlayer . parentNode ;
143- appendTo . removeChild ( videoPlayer ) ;
144149
145150 console . log ( "[CR Beta] Pegando dados da stream..." ) ;
146151 var external_lang = preservedState . localization . locale . toLowerCase ( )
@@ -153,12 +158,14 @@ function importBetaPlayer(ready = false) {
153158 var old_url = `https://www.crunchyroll.com/${ external_lang } /${ series_slug } /episode-${ external_id } `
154159 var up_next = document . querySelector ( '[data-t="next-episode"] > a' )
155160 var playback = ep . playback
161+ var series = document . querySelector ( '.show-title-link > h4' ) ?. innerText ;
156162
157163 var message = {
158164 'playback' : playback ,
159165 'old_url' : old_url ,
160166 'lang' : ep_lang ,
161167 'up_next' : up_next ? up_next . href : undefined ,
168+ 'series' : series ? series : undefined ,
162169 }
163170
164171 console . log ( "[CR Beta] Adicionando o jwplayer..." ) ;
@@ -186,7 +193,7 @@ function addPlayer(element, playerInfo, beta = false) {
186193 playerInfo [ 'up_next_cooldown' ] = items . cooldown === undefined ? 5 : items . cooldown ;
187194 playerInfo [ 'up_next_enable' ] = items . aseguir === undefined ? true : items . aseguir ;
188195 playerInfo [ 'force_mp4' ] = items . forcemp4 === undefined ? false : items . forcemp4 ;
189- playerInfo [ 'version' ] = '1.2.1 ' ;
196+ playerInfo [ 'version' ] = '1.2.2 ' ;
190197 playerInfo [ 'noproxy' ] = true ;
191198 playerInfo [ 'beta' ] = beta ;
192199 ifrm . contentWindow . postMessage ( playerInfo , "*" ) ;
@@ -233,6 +240,7 @@ function registerChangeEpisode() {
233240 if ( currentURL !== window . location . href ) {
234241 currentURL = window . location . href
235242 if ( currentURL . includes ( "/watch/" ) ) {
243+ remove ( ".erc-watch-premium-upsell" , "New Premium Sidebar" , true )
236244 const HTML = await fetch ( currentURL )
237245 console . log ( "[CR Beta] Searching for new INITIAL_STATE" )
238246 preservedState = JSON . parse ( pegaString ( HTML , "__INITIAL_STATE__ = " , ";" ) )
@@ -273,3 +281,8 @@ function fetch(url) {
273281 xhr . send ( ) ;
274282 } )
275283}
284+
285+ var s = document . createElement ( 'script' ) ;
286+ s . src = chrome . runtime . getURL ( 'blockevidon.js' ) ;
287+ s . onload = function ( ) { this . remove ( ) ; } ;
288+ ( document . head || document . documentElement ) . appendChild ( s ) ;
0 commit comments