Skip to content

Command line tool for getting and setting a default browser (HTTP handler) in Mac OS X

License

Notifications You must be signed in to change notification settings

alissa-huskey/defaultbrowser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

defaultbrowser

Command line tool for setting the default browser (HTTP handler) in macOS.

Install

Build it:

make

Install it into your executable path:

make install

Usage

  COMMANDS:
  -ls, list         list all available HTTP handlers and show the current setting
  -g,  get          print the current browser
  -h, help          show this screen
  set <BROWSER>     set the default browser to <BROWSER>

EXAMPLES:
  defaultbrowser set chrome
  defaultbrowser set "google chrome"
  defaultbrowser set com.google.chrome

Examples

list all available browsers and show the current setting

$ defaultbrowser list
  firefox
  chrome
* safari

set the browser to chrome

$ defaultbrowser set chrome

print the current browser

$ defaultbrowser get
safari

How does it work?

The code uses the macOS Launch Services API.

License

MIT

Credits

Forked from kerma/defaultbrowser

About

Command line tool for getting and setting a default browser (HTTP handler) in Mac OS X

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 95.2%
  • Makefile 4.8%