File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 2525// @grant GM.setValue
2626// @grant GM.xmlHttpRequest
2727//
28- // @version 1.4.10
28+ // @version 1.4.11
2929// @author tophf
3030//
3131// @original -version 2017.9.29
@@ -1636,17 +1636,21 @@ const Ruler = {
16361636 } `,
16371637 } ) ; break ;
16381638
1639- case 'google' : if ( / [ & ? ] ( s c l i e n t = i m g | u d m = 2 ) ( & | $ ) / . test ( location . search ) ) rules . push ( {
1640- e : '[data-docid] img' ,
1641- s : ( m , el ) => {
1642- const { docid} = ( el = el . closest ( '[data-docid]' ) ) . dataset ;
1639+ case 'google' : if ( location . pathname === '/search' ) rules . push ( {
1640+ e : / [ & ? ] ( s c l i e n t = i m g | u d m = 2 ) ( & | $ ) / . test ( location . search )
1641+ ? '[data-docid] img'
1642+ : '[jsdata][id] img' ,
1643+ s : ( m , el , rule ) => {
1644+ el = el . closest ( rule . e . split ( ' ' ) [ 0 ] ) ;
1645+ const id = el . dataset . docid || el . id ;
16431646 if ( isFF ) el = el . wrappedJSObject || el ;
16441647 if ( ( el = el . __jscontroller ) && ( el = el . pending ) && ( el = el . value ) )
16451648 for ( let a in el )
16461649 if ( ( { } ) . toString . call ( a = el [ a ] ) === '[object Object]' )
16471650 for ( const b in a )
1648- if ( Array . isArray ( m = a [ b ] ) && m . includes ( docid ) && ( m = m [ 1 ] )
1649- && Array . isArray ( m = m [ b ] ) && m [ 1 ] === docid && Array . isArray ( m = m [ 3 ] ) )
1651+ if ( Array . isArray ( m = a [ b ] ) && m . includes ( id )
1652+ && ( m [ 1 ] === id || ( m = m [ 1 ] ) && Array . isArray ( m = m [ b ] ) && m [ 1 ] === id )
1653+ && Array . isArray ( m = m [ 3 ] ) )
16501654 return m [ 0 ] ;
16511655 } ,
16521656 } ) ; break ;
You can’t perform that action at this time.
0 commit comments