@@ -140,6 +140,9 @@ function importBetaPlayer(ready = false) {
140140 if ( query ( '.video-player' ) && lastWatchedPlayer )
141141 lastWatchedPlayer . parentNode . removeChild ( lastWatchedPlayer ) ;
142142
143+ var titleLink = query ( '.show-title-link' )
144+ if ( titleLink ) titleLink . style . zIndex = "2" ;
145+
143146 console . log ( "[CR Beta] Removendo player da Crunchyroll..." ) ;
144147 remove ( '.video-player-placeholder' , 'Video Placeholder' ) ;
145148 remove ( '.video-player' , 'Video Player' , true ) ;
@@ -151,10 +154,10 @@ function importBetaPlayer(ready = false) {
151154 var external_lang = preservedState . localization . locale . toLowerCase ( )
152155 var ep_lang = preservedState . localization . locale . replace ( '-' , '' )
153156 var ep_id = preservedState . watch . id
154- var ep = preservedState . content . byId [ ep_id ]
157+ var ep = preservedState . content . media . byId [ ep_id ]
155158 if ( ! ep ) { window . location . reload ( ) ; return ; }
156- var series_slug = ep . episode_metadata . series_slug_title
157- var external_id = ep . external_id . substr ( 4 )
159+ var series_slug = ep . parentSlug
160+ var external_id = getExternalId ( ep . id ) . substr ( 4 )
158161 var old_url = `https://www.crunchyroll.com/${ external_lang } /${ series_slug } /episode-${ external_id } `
159162 var up_next = document . querySelector ( '[data-t="next-episode"] > a' )
160163 var playback = ep . playback
@@ -193,7 +196,7 @@ function addPlayer(element, playerInfo, beta = false) {
193196 playerInfo [ 'up_next_cooldown' ] = items . cooldown === undefined ? 5 : items . cooldown ;
194197 playerInfo [ 'up_next_enable' ] = items . aseguir === undefined ? true : items . aseguir ;
195198 playerInfo [ 'force_mp4' ] = items . forcemp4 === undefined ? false : items . forcemp4 ;
196- playerInfo [ 'version' ] = '1.2.2 ' ;
199+ playerInfo [ 'version' ] = '1.3.0 ' ;
197200 playerInfo [ 'noproxy' ] = true ;
198201 playerInfo [ 'beta' ] = beta ;
199202 ifrm . contentWindow . postMessage ( playerInfo , "*" ) ;
@@ -282,7 +285,11 @@ function fetch(url) {
282285 } )
283286}
284287
288+ function getExternalId ( id ) {
289+ return JSON . parse ( localStorage . getItem ( 'externalIds' ) ) [ id ] ;
290+ }
291+
285292var s = document . createElement ( 'script' ) ;
286- s . src = chrome . runtime . getURL ( 'blockevidon .js' ) ;
293+ s . src = chrome . runtime . getURL ( 'interceptor .js' ) ;
287294s . onload = function ( ) { this . remove ( ) ; } ;
288295( document . head || document . documentElement ) . appendChild ( s ) ;
0 commit comments