File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,20 @@ class BookmarkSearch {
1414 if ( this . host . endsWith ( '.baidu.com' ) ) {
1515 this . getKeyword = ( ) => ( $ ( '#kw' ) [ 0 ] [ 'value' ] as string )
1616 this . innerClass = '#content_left'
17+ let interval = null
1718 $ ( '#kw' ) . bind ( 'input propertychange' , ( ) => {
18- this . sendSearch ( this . getKeyword ( ) )
19+ // Have to wait for the container to appear
20+ if ( interval !== null ) {
21+ clearInterval ( interval )
22+ interval = null
23+ }
24+ interval = setInterval ( ( ) => {
25+ if ( $ ( this . innerClass ) . length > 0 ) {
26+ clearInterval ( interval )
27+ interval = null
28+ this . sendSearch ( this . getKeyword ( ) )
29+ }
30+ } , 100 )
1931 } )
2032 } else if ( this . host . startsWith ( 'www.google.' ) ) {
2133 this . getKeyword = ( ) => ( $ ( 'input.gsfi' ) [ 0 ] [ 'value' ] as string )
You can’t perform that action at this time.
0 commit comments