@@ -171,7 +171,7 @@ export class CodeApplication extends Disposable {
171171 app . on ( 'web-contents-created' , ( _event : Event , contents ) => {
172172 contents . on ( 'will-attach-webview' , ( event : Event , webPreferences , params ) => {
173173
174- const isValidWebviewSource = ( source : string ) : boolean => {
174+ const isValidWebviewSource = ( source : string | undefined ) : boolean => {
175175 if ( ! source ) {
176176 return false ;
177177 }
@@ -191,11 +191,11 @@ export class CodeApplication extends Disposable {
191191 webPreferences . nodeIntegration = false ;
192192
193193 // Verify URLs being loaded
194- if ( isValidWebviewSource ( params . src ) && isValidWebviewSource ( webPreferences . preloadURL ) ) {
194+ if ( isValidWebviewSource ( params . src ) && isValidWebviewSource ( webPreferences . preload ) ) {
195195 return ;
196196 }
197197
198- delete webPreferences . preloadUrl ;
198+ delete ( webPreferences as { preloadURL : string } ) . preloadURL ; // https://github.com/electron/electron/issues/21553
199199
200200 // Otherwise prevent loading
201201 this . logService . error ( 'webContents#web-contents-created: Prevented webview attach' ) ;
@@ -497,27 +497,27 @@ export class CodeApplication extends Disposable {
497497 this . logService . info ( `Tracing: waiting for windows to get ready...` ) ;
498498
499499 let recordingStopped = false ;
500- const stopRecording = ( timeout : boolean ) => {
500+ const stopRecording = async ( timeout : boolean ) => {
501501 if ( recordingStopped ) {
502502 return ;
503503 }
504504
505505 recordingStopped = true ; // only once
506506
507- contentTracing . stopRecording ( join ( homedir ( ) , `${ product . applicationName } -${ Math . random ( ) . toString ( 16 ) . slice ( - 4 ) } .trace.txt` ) , path => {
508- if ( ! timeout ) {
509- if ( this . dialogMainService ) {
510- this . dialogMainService . showMessageBox ( {
511- type : 'info' ,
512- message : localize ( 'trace.message' , "Successfully created trace." ) ,
513- detail : localize ( 'trace.detail' , "Please create an issue and manually attach the following file:\n{0}" , path ) ,
514- buttons : [ localize ( 'trace.ok' , "Ok" ) ]
515- } , withNullAsUndefined ( BrowserWindow . getFocusedWindow ( ) ) ) ;
516- }
517- } else {
518- this . logService . info ( `Tracing: data recorded (after 30s timeout) to ${ path } ` ) ;
507+ const path = await contentTracing . stopRecording ( join ( homedir ( ) , `${ product . applicationName } -${ Math . random ( ) . toString ( 16 ) . slice ( - 4 ) } .trace.txt` ) ) ;
508+
509+ if ( ! timeout ) {
510+ if ( this . dialogMainService ) {
511+ this . dialogMainService . showMessageBox ( {
512+ type : 'info' ,
513+ message : localize ( 'trace.message' , "Successfully created trace." ) ,
514+ detail : localize ( 'trace.detail' , "Please create an issue and manually attach the following file:\n{0}" , path ) ,
515+ buttons : [ localize ( 'trace.ok' , "Ok" ) ]
516+ } , withNullAsUndefined ( BrowserWindow . getFocusedWindow ( ) ) ) ;
519517 }
520- } ) ;
518+ } else {
519+ this . logService . info ( `Tracing: data recorded (after 30s timeout) to ${ path } ` ) ;
520+ }
521521 } ;
522522
523523 // Wait up to 30s before creating the trace anyways
0 commit comments