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
 |         // encode URL so if it contains spaces, it remains a single argument for the browser
 | ||||||
|         linkUrl = encodeURI(linkUrl); |         linkUrl = encodeURI(linkUrl); | ||||||
| 
 | 
 | ||||||
|         // replace %s in arguments with URL, otherwise add the URL at the end
 |         if(!settings.browserArgs.includes('%s')) { | ||||||
|         let link = settings.browserArgs.includes('%s') ? settings.browserArgs.replace('%s', linkUrl) : `${settings.browserArgs} ${linkUrl}`; |             // 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; |         const execFile = require('child_process').exec; | ||||||
|         execFile(`"${settings.browserPath}" ${link}`); |         execFile(`"${settings.browserPath}" ${link}`); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user