Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Commit

Permalink
Make compatible with system default browser
Browse files Browse the repository at this point in the history
  • Loading branch information
spikespaz committed Jun 30, 2018
1 parent d2b2d16 commit aed9b39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deflect.d
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ string[string] getRegistryInfo() {

// Open a URL by spawning a shell process to the browser executable, or system default.
void openURI(const string browserPath, const string url) {
spawnShell('"' ~ browserPath ~ "\" \"" ~ url ~ '"');
if (browserPath == "system_default")
spawnShell("start \"\" " ~ url ~ '"');
else
spawnShell("start \"\" \"" ~ browserPath ~ "\" \"" ~ url ~ '"');
}

// Parse the query parameters from a URI and return as an associative array.
Expand Down

0 comments on commit aed9b39

Please sign in to comment.