Giter Club home page Giter Club logo

defaultbrowser's Introduction

defaultbrowser

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

Install

Build it:

make

Install it into your executable path:

make install

Usage

Set the default browser with, e.g.:

defaultbrowser chrome

Running defaultbrowser without arguments lists available HTTP handlers and shows the current setting.

How does it work?

The code uses the macOS Launch Services API.

Additional Resources

License

MIT

defaultbrowser's People

Contributors

domt4 avatar i0ntempest avatar jonasbn avatar jrogers512 avatar kerma avatar saifulwebid avatar specious avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

defaultbrowser's Issues

New browser 'Arc'

Hey

Is it possible for the script to detect the new browser 'arc' too?
I notice it does not recognise it in the returned list.

I get these ones;

iterm2
  chrome
* safari
  b99b77c39738484f8a5516125745b0d7
  browser
  torbrowser
  console
  firefox

Kind regards

Jonas

Add Brave browser as available option

I would like to add Brave as an option to change default browsers.
I found the list of acceptable browsers following links in the readme and it looks like Brave is not on the list.

Option to wait for completion?

It would be great to be able to add this to a shell script and have a way defaultbrowser wait until the dialog box has been closed before continuing on.

ie:
defaultbrowser firefox &&next item&&defaultbrowser chrome

Thanks in advance.

Doesn't detect Chrome on macOS Catalina

Ever since I updated to macOS Catalina (currently at 10.15.2 (19C57)) defaultbrowser stopped detecting Chrome if it's the currently active browser. It broke a script I use to toggle between Chrome (which I use at work) & Firefox (which I use at home) as a default browser.

If Firefox is the default, I get this:

$ defaultbrowser
  opera
  gif-brewery-3
  torbrowser
  beta
* firefox
  console
  canary
  dev
  firefoxdeveloperedition
  nightly
  chrome
  browser
  iterm2
  desktop
  chromium
  vivaldi
  safari
  27ef764e1843433bb31581d42d97c90c
  safaritechnologypreview

However, if Chrome is the default, I get this:

$ defaultbrowser          
  opera
  gif-brewery-3
  chrome
  beta
  torbrowser
  console
  canary
  dev
  firefoxdeveloperedition
  nightly
  firefox
  browser
  iterm2
  desktop
  chromium
  vivaldi
  safari
  27ef764e1843433bb31581d42d97c90c
  safaritechnologypreview

New release?

This is an awesome tool. ❤️

1.1 is the latest release, but it's from 2018, and Homebrew is still on 1.1.

Any chance you can put out a new release?

Thanks!

Distribution of your program in an Alfred workflow

Hi Margus,
I am putting together an Alfred workflow that I would like to use your defaultbrowser program in. The simplest method to put this together is to include the binary in with the Alfred workflow rather than writing a series of scripts to try to download it/put it in the right location etc etc.

Would you please permit me to create an Alfred Workflow (http://alfredapp.com) providing that I put the attribution to yourself in the README files for the workflow detailing the supporting program you have written?

Many thanks
Stuart

Homebrew formula?

This utility is useful. It would be nice to have convenient installation of it through homebrew. A formula should be quite easy to write.

OS X 10.10.1: Setting a new default browser failed

I was trying to get around the new and annoying "Do you want to keep your default browser 'x' or keep using 'x'?" dialog window that was introduced in OS X Yosemite:

example

When I execute the following command "defaultbrowser -set safari" or "defaultbrowser -set chrome", I get this error along with the pictured dialog box:

Setting a new default browser failed

Do you know if your tool will be able to bypass the new dialog window at some point?

Thanks,
Morgan

Safari

I have tried to use the defaultbrowser, but when trying to set safari as default it just show "Safari is not available as an HTTP handler" Running Big sur 11.4

Is it possible to set the default browser silently?

I wanted to use this in a python script so I was hoping to find a silent way to change my default browser, without the annoying pop-up.

I tried using sudo defaultbrowser -set <browser> but it doesn't set the browser in that case and it's probably a bad idea too.

'make install' should create $(PREFIX)/bin

The make install target for this program does not ensure that the bin directory which it installs to is actually there. This led to a complaint from a homebrew maintainer, saying that this should be fixed here. It should be as simple as adding this:

install:
	mkdir -p $(PREFIX)/bin # add this
	cp $(BIN) $(PREFIX)/bin/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.