Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions WikiFunctions/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1576,31 +1576,16 @@ public static void OpenArticleInBrowser(string title)
OpenURLInBrowser(Variables.NonPrettifiedURL(title));
}

private static string WineBrowserPath;
/// <summary>
/// Error supressed URL opener in default browser (Windows) or Firefox/Chromium/Konqueror for Wine
/// Error supressed URL opener in default browser
/// </summary>
public static void OpenURLInBrowser(string url)
{
// For Wine use attempt to dynamically determine available browser, caching result
if (WineBrowserPath == null)
{
if (File.Exists("/usr/bin/firefox"))
WineBrowserPath = "/usr/bin/firefox";
else if (File.Exists("/usr/bin/chromium-browser"))
WineBrowserPath = "/usr/bin/chromium-browser";
else if (File.Exists("/usr/bin/konqueror"))
WineBrowserPath = "/usr/bin/konqueror";
else WineBrowserPath = ""; // Windows, or Wine and none of these browsers available
}
try
{
if (!Globals.UnitTestMode)
{
if (WineBrowserPath.Length > 0) // Wine
System.Diagnostics.Process.Start(WineBrowserPath, url);
else // Windows
System.Diagnostics.Process.Start(url);
System.Diagnostics.Process.Start(url);
}
}
catch { }
Expand Down