22// @name VIP视频破解
33// @name :en VIP Video Cracker
44// @namespace hoothin
5- // @version 1.5.2
5+ // @version 1.5.3
66// @description 解析并破解各大视频站的VIP权限
77// @description :en Crack VIP permissions of some chinese video sites
88// @author hoothin
134134 }
135135 }
136136 var si = setInterval ( function ( ) {
137- [ ] . every . call ( document . querySelectorAll ( "object,embed" ) , function ( item ) {
137+ [ ] . every . call ( document . querySelectorAll ( "object,embed,video " ) , function ( item ) {
138138 var style = getComputedStyle ( item , null ) ;
139139 if ( style . width . replace ( "px" , "" ) > 100 && style . height . replace ( "px" , "" ) > 100 ) {
140140 video = item ;
151151 jumpCheck . checked = true ;
152152 }
153153 crackJump ( ) ;
154- var pushState = unsafeWindow . history . pushState ;
155- var replaceState = unsafeWindow . history . replaceState ;
156- unsafeWindow . history . pushState = function ( state ) {
157- setTimeout ( function ( ) { crackJump ( ) ; } , 1 ) ;
154+ unsafeWindow . eval ( `
155+ var pushState = window .history.pushState ;
156+ window .history.pushState=function(a ){
157+ window.postMessage("pushState","*" );
158158 return pushState.apply(history, arguments);
159159 };
160- unsafeWindow . history . replaceState = function ( state ) {
161- setTimeout ( function ( ) { crackJump ( ) ; } , 1 ) ;
162- return replaceState . apply ( history , arguments ) ;
163- } ;
160+ var replaceState = window.history.pushState;
161+ window.history.replaceState=function(a){
162+ window.postMessage("replaceState","*");
163+ return pushState.apply(history, arguments);
164+ };` ) ;
165+ window . addEventListener ( 'message' , function ( e ) {
166+ if ( e . data == "pushState" || e . data == "replaceState" ) {
167+ setTimeout ( function ( ) { crackJump ( ) ; } , 1 ) ;
168+ }
169+ } ) ;
164170 if ( iqiyi ) {
165171 document . querySelector ( '#widget-dramaseries' ) . addEventListener ( 'click' , function ( e ) {
166172 var target = e . target . parentNode ;
180186 crackJump ( ) ;
181187 } ) ;
182188 }
183- } else if ( i ++ > 10 ) {
184- clearInterval ( si ) ;
185- console . log ( "no player!" ) ;
186189 }
187190 } , 500 ) ;
188191} ) ( ) ;
0 commit comments