File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -341,12 +341,19 @@ export const attachGuestWebContentsEvents = (rootWindow: BrowserWindow): void =>
341341 newWindow . show ( ) ;
342342 } ) ;
343343
344- newWindow . loadURL ( url , {
345- httpReferrer : referrer ,
346- ...postBody && {
347- extraHeaders : `Content-Type: ${ postBody . contentType } ; boundary=${ postBody . boundary } ` ,
348- postData : postBody . data as unknown as ( UploadRawData [ ] | UploadBlob [ ] | UploadFile [ ] ) ,
349- } ,
344+ isProtocolAllowed ( url ) . then ( ( allowed ) => {
345+ if ( ! allowed ) {
346+ newWindow . destroy ( ) ;
347+ return ;
348+ }
349+
350+ newWindow . loadURL ( url , {
351+ httpReferrer : referrer ,
352+ ...postBody && {
353+ extraHeaders : `Content-Type: ${ postBody . contentType } ; boundary=${ postBody . boundary } ` ,
354+ postData : postBody . data as unknown as ( UploadRawData [ ] | UploadBlob [ ] | UploadFile [ ] ) ,
355+ } ,
356+ } ) ;
350357 } ) ;
351358
352359 event . newGuest = newWindow ;
You can’t perform that action at this time.
0 commit comments