x Fixed an issue with openURLExternally() that caused some links to be passed to custom browser incorrectly
This commit is contained in:
		
							parent
							
								
									d038654538
								
							
						
					
					
						commit
						77fcaaf095
					
				| @ -180,8 +180,13 @@ function openURLExternally(linkUrl: string): void { | ||||
|         // encode URL so if it contains spaces, it remains a single argument for the browser
 | ||||
|         linkUrl = encodeURI(linkUrl); | ||||
| 
 | ||||
|         // replace %s in arguments with URL, otherwise add the URL at the end
 | ||||
|         let link = settings.browserArgs.includes('%s') ? settings.browserArgs.replace('%s', linkUrl) : `${settings.browserArgs} ${linkUrl}`; | ||||
|         if(!settings.browserArgs.includes('%s')) { | ||||
|             // append %s to params if it is not already there
 | ||||
|             settings.browserArgs += ' %s'; | ||||
|         } | ||||
| 
 | ||||
|         // replace %s in arguments with URL and encapsulate in quotes to prevent issues with spaces and special characters in the path
 | ||||
|         let link = settings.browserArgs.replace('%s', '\"'+linkUrl+'\"'); | ||||
| 
 | ||||
|         const execFile = require('child_process').exec; | ||||
|         execFile(`"${settings.browserPath}" ${link}`); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user