File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export const configSchemata = {
3636 useManualProxy : z . boolean ( ) ,
3737 useProxy : z . boolean ( ) ,
3838 useSystemProxy : z . boolean ( ) ,
39+ whitelistedProtocols : z . string ( ) . array ( ) ,
3940} ;
4041
4142export const enterpriseConfigSchemata = {
Original file line number Diff line number Diff line change @@ -3,10 +3,20 @@ import fs from "node:fs";
33import os from "node:os" ;
44import path from "node:path" ;
55
6+ import * as ConfigUtil from "./config-util.ts" ;
67import { html } from "./html.ts" ;
78
9+ /* Fetches the current protocolLaunchers from settings.json */
10+ const whitelistedProtocols = ConfigUtil . getConfigItem ( "whitelistedProtocols" , [
11+ "http:" ,
12+ "https:" ,
13+ "mailto:" ,
14+ "tel:" ,
15+ "sip:" ,
16+ ] ) ;
17+
818export async function openBrowser ( url : URL ) : Promise < void > {
9- if ( [ "http:" , "https:" , "mailto:" ] . includes ( url . protocol ) ) {
19+ if ( whitelistedProtocols . includes ( url . protocol ) ) {
1020 await shell . openExternal ( url . href ) ;
1121 } else {
1222 // For security, indirect links to non-whitelisted protocols
You can’t perform that action at this time.
0 commit comments