james-browser-launcher icon indicating copy to clipboard operation
james-browser-launcher copied to clipboard

Default browser

Open arkihillel opened this issue 8 years ago • 3 comments

If possible, getting the OS default browser through detect would be nice!

arkihillel avatar Sep 17 '17 21:09 arkihillel

For OS X: https://stackoverflow.com/q/32458095

x=~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist; \
plutil -convert xml1 $x; \
grep 'https' -b3 $x | awk 'NR==2 {split($2, arr, "[><]"); print arr[3]}'; \
plutil -convert binary1 $x

Linux: https://portland.freedesktop.org/doc/xdg-settings.html

xdg-settings get default-web-browser

Windows: https://stackoverflow.com/q/2177957

In the registry

HKEY_CURRENT_USER\Software\Classes\http\shell\open\command\(Default)

arkihillel avatar Sep 17 '17 22:09 arkihillel

See also https://github.com/sindresorhus/default-browser and https://github.com/jakub-g/x-default-browser

vweevers avatar Sep 18 '17 00:09 vweevers

Good catch! Seems like it's using all of the tricks listed above

arkihillel avatar Sep 18 '17 06:09 arkihillel