File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,22 @@ export const setOpenUrl = (url: string): void => {
2727 }
2828
2929 // OR: if (new URL(url).protocol === "thorium:")
30- if ( url . startsWith ( "thorium://" ) ) {
30+ else if ( url . startsWith ( "thorium://" ) ) {
3131 const openUrl = url . replace ( "thorium://" , "http://" ) ; // HTTP to HTTPS redirect should be handled by the server
3232
3333 const buf = getOpenUrlWithThoriumSchemeEventChannel ( ) ;
3434 buf . put ( openUrl ) ;
3535 }
3636
37+ // only from the CLI we accept http/https protocols
38+ else if ( url . startsWith ( "http://" ) || url . startsWith ( "https://" ) ) {
39+ const openUrl = url ;
40+
41+ const buf = getOpenUrlWithThoriumSchemeEventChannel ( ) ;
42+ buf . put ( openUrl ) ;
43+ }
44+
45+ else {
46+ process . stderr . write ( "Cannot open URL with this protocol" ) ;
47+ }
3748} ;
You can’t perform that action at this time.
0 commit comments