Home
Softono
alfred-set-default-browser

alfred-set-default-browser

Open source MIT Swift
35
Stars
2
Forks
1
Issues
2
Watchers
11 months
Last Commit

About alfred-set-default-browser

<h1 align="center"> <img src="img/icon.png"></br> Default Browser</br> <a href="https://github.com/zeitlings/alfred-set-default-browser/releases"><img src="https://img.shields.io/github/v/release/zeitlings/alfred-set-default-browser.svg" alt="GitHub Release"></a> </h1> An [Alfred](https://www.alfredapp.com/) workflow to set the default web browser. ## Usage Note - Set the default web browser using the keyword (default: `sdb`). - The macOS browser change confirmation dialog is automatically accepted. <img src="img/sdb1.png" width="630px"> - <kbd>⏎</kbd> Set as default browser - <kbd>⌘</kbd><kbd>⇧</kbd><kbd>⏎</kbd> Blacklist the application - <kbd>⌃</kbd> View the file path of the application **Utility**: Use the workflow's [File Action](https://www.alfredapp.com/help/workflows/triggers/file-action/) (name: `Bundle Identifier Information`) to retrieve an application's bundle identifier (Legacy). <img src="img/sdb2.png" width="630px"> <img src="img/sdb3.png" width="630px"> --- ## Compiled ...

Platforms

Web Self-hosted macOS iOS

Languages

Swift

Links


Default Browser
GitHub Release

An Alfred workflow to set the default web browser.

Usage Note

  • Set the default web browser using the keyword (default: sdb).
  • The macOS browser change confirmation dialog is automatically accepted.
  • Set as default browser
  • Blacklist the application
  • View the file path of the application

Utility: Use the workflow's File Action (name: Bundle Identifier Information) to retrieve an application's bundle identifier (Legacy).


Compiled Version (command line)

See Details

The executable can be used to change the default browser from the command line: ./set_default_browser tor

Recompile

In your terminal:

mkdir set-default-browser
cd set-default-browser
swift package init --type executable

This will generate the following structure for you:

.
├── Package.swift
├── README.md
├── Sources
│   └── set_default_browser
│       └── set_default_browser.swift
└── Tests
    └── set_default_browserTests
        └── set_default_browserTests.swift

Replace the contents of set_default_browser.swift with the contents of the included main.swift.
Replace the contents of Package.swift with the contents of the included Package.swift

In your terminal, run:

swift build -c release

The executable is located in .build/release/ (hidden folder) and is called set_default_browser. release is a symbolic link and, in my case, the path reads: /.build/arm64-apple-macosx/release/set_default_browser. Depending on your system, this might differ.

Copy the executable and replace the version that comes with the workflow.

Some Popular Browsers

 Name           | Bundle Identifier
--------------------------------------------
Safari          | com.apple.Safari
Google Chrome       | com.google.Chrome
Firefox         | org.mozilla.firefox
Opera           | com.operasoftware.Opera
Brave Browser       | com.brave.Browser
Tor Browser     | org.torproject.torbrowser
Microsoft Edge      | com.microsoft.edgemac
Vivaldi         | com.vivaldi.Vivaldi

Credit