james-browser-launcher
james-browser-launcher copied to clipboard
Default browser
If possible, getting the OS default browser through detect would be nice!
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)
See also https://github.com/sindresorhus/default-browser and https://github.com/jakub-g/x-default-browser
Good catch! Seems like it's using all of the tricks listed above