How to use the startsWith function from url
Find comprehensive JavaScript url.startsWith code examples handpicked from public code repositorys.
GitHub: sandialabs/InterSpec
713 714 715 716 717 718 719 720 721 722
newWindow.webContents.setWindowOpenHandler(({ url }) => { //console.log( 'url=' + url ); //console.log( 'frameName=' + frameName ); //console.log( 'additionalFeatures=' + additionalFeatures ); if( url.startsWith(interspec_url) ) { //Lets prevent a weird popup window that the user has to close... // I think this is because InterSpec targets a new window for downloads. newWindow.webContents.downloadURL(url); } else {
12
72
12