Web browser ?? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- madref · 2021-10-12 10:18 How can one check which webbrowsers are installed on a system and then choose one of them? ---------------------------------------------------------------------- Mr.Madguy · 2021-10-12 19:20 What OS? On Windows you need to check something like HKLM\SOFTWARE\[Wow6432Node \]Microsoft\Windows\CurrentVersion\Uninstall. On Linux-based system you need to run it's package manager console application and check it's output. ---------------------------------------------------------------------- speter · 2021-10-12 22:34 I think there is a way (in windows at least) to "run" the default browser.... Have a look at "RunCommand" & "OpenDocument". Edit: I had a look at OpenDocument; and it worked without any issues. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses lclintf; // add this to your uses clause ... procedure whatever;begin  OpenDocument('somefile.html');  // opens a file (located in the exe's folder) in the default browserend; cheers S. ---------------------------------------------------------------------- trev · 2021-10-13 23:29 For macOS, see LSCopyApplicationURLsForURL ---------------------------------------------------------------------- dbannon · 2021-10-14 00:10 I think what madref wants is a list of browsers rather that the default or user chosen browser. I suspect that might be hard. On Linux, you can search for installed packages under the Section "World Wide Web", that will pick up Firefox or Google Chrome on my Ubuntu install for example. But also wget and will not pickup Konqueror. Hmm... What if user has decided to manually install Vivaldi ? Maybe better to search for know binary names. Don't forget many Ubuntu users are now installing Chrome directly from Google because Ubuntu decided to make it available only in a Snap from its repositories. Sigh ... Not easy. Davo ---------------------------------------------------------------------- trev · 2021-10-14 06:20 Quote from: dbannon on October 14, 2021, 02:10:21 amI think what madref wants is a list of browsers rather that the default or user chosen browser. I suspect that might be hard The macOS function returns the full list of browsers with the first entry being the "preferred default" or "best" as macOS calls it. ---------------------------------------------------------------------- madref · 2021-10-15 15:55 Quote from: trev on October 14, 2021, 01:29:30 amFor macOS, see LSCopyApplicationURLsForURL And how can I address this in Lazarus? ---------------------------------------------------------------------- trev · 2021-10-15 21:56 @MadRef - see fpcsrc/fpc-3.x.x/packages/univint/src/LSInfo.pas for the Launch Services Framework.