File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed
Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 66 "type" : " node" ,
77 "request" : " launch" ,
88 "runtimeExecutable" : " ${workspaceFolder}/node_modules/.bin/electron" ,
9- "args" : [" ${workspaceFolder}/test/sample.js" ],
9+ "args" : [" --trace-warnings " , " ${workspaceFolder}/test/sample.js" ],
1010 "preLaunchTask" : " build:dev" ,
1111 "env" : {
1212 "NODE_ENV" : " development"
Original file line number Diff line number Diff line change 2222 "build" : " npm run clean && webpack" ,
2323 "build:dev" : " npm run clean && NODE_ENV=development webpack" ,
2424 "dev" : " webpack --mode development --watch" ,
25- "sample" : " electron test/sample.js"
25+ "sample" : " electron --trace-warnings test/sample.js"
2626 },
2727 "repository" : {
2828 "type" : " git" ,
Original file line number Diff line number Diff line change @@ -68,8 +68,10 @@ class Findbar {
6868 if ( ! this . findableContents ) { throw new Error ( 'There are no searchable web contents.' ) ; }
6969
7070 this . findableContents . _findbar = this ;
71-
72- this . findableContents . once ( 'destroyed' , ( ) => { this . detach ( ) ; } ) ;
71+ this . findableContents . prependOnceListener ( 'destroyed' , ( ) => { this . detach ( ) ; } ) ;
72+ this . findableContents . prependListener ( 'found-in-page' , ( _e , result : FindInPageResult ) => {
73+ this . sendMatchesCount ( result . activeMatchOrdinal , result . matches ) ;
74+ } ) ;
7375 this . updateParentWindow ( parent ) ;
7476 }
7577
@@ -369,12 +371,6 @@ class Findbar {
369371 this . window ! . webContents . prependListener ( 'before-input-event' , ( event , input ) => {
370372 this . registerKeyboardShortcuts ( event , input ) ;
371373 } ) ;
372- this . findableContents . prependOnceListener ( 'destroyed' , ( ) => {
373- this . close ( ) ;
374- } ) ;
375- this . findableContents . prependListener ( 'found-in-page' , ( _e , result : FindInPageResult ) => {
376- this . sendMatchesCount ( result . activeMatchOrdinal , result . matches ) ;
377- } ) ;
378374 }
379375
380376 private sendMatchesCount ( active : number , total : number ) : void {
You can’t perform that action at this time.
0 commit comments