stuartcryan Posted July 25, 2015 Share Posted July 25, 2015 (edited) Change your default web browser quickly and easily from within Alfred. Simple yet effective, this workflow enablea you to easily change your default browser. The official repository is located on Github --> https://github.com/stuartcryan/defaultbrowser-alfred-workflow where any issues can be logged on the issue tracker. I have also put this workflow on Packal. Update Version 1.2 released September 10, 2015: What has changed: Feature: Support additional browsers - added FirefoxDeveloperEdition and Webkit Nightly BuildUpdate Version 1.1 released August 8, 2015: What has changed: Feature: Support additional browsers - added Chromium, Canary and SeaMonkey Feature: Only show installed browsers Feature: Indicate which browser is the current default Feature: Added hotkey assignments (to launch workflow, launch with "chrome", and launch with "safari") Improvement: Renamed description in Alfred to simply "Default Browser" Improvement: Improved failure feedback Improvement: Major code refactor to remove duplication and speed up the workflow Improvement: Added an icon to the workflow Improvement: defaultbrowser binary has been updated to better support integrating. This code has been put into a pull request for the official publication of defaultbrowser. Workflow Details: A simple workflow to allow quick and easy changing of the default browser on OSX using a workflow in Alfred. Installation Download the .alfredworkflow file or you can get it on Packal. Run to import into Alfred Donations This workflow represents many hours effort of development, testing and rework. The images that have been licensed for this workflow from DepositPhotos also needed a bit of my moolah. So if you love the workflow, and get use out of it every day, if you would like to donate as a thank you to buy me more caffeine giving Diet Coke, some Cake, or to put towards a shiny new gadget you can donate to me via Paypal. You should also consider getting into contact with Margus Kerma and donating to Margus also for the work that has bene put into the defaultbrowser binary. Usage db < browser > Note - if you try to set the default browser that is already active as the default you will just get a notification. Browsers currently supported: Chrome Firefox Opera Safari Chromium - New in V1.1 Canary - New in V1.1 SeaMonkey - New in V1.1 Screenshots Troubleshooting If you are finding that you are seeing browsers listed that you have installed previously but no longer have on your system you will need to clear out all your default handlers. Unfortunately, this is the only solution I have found to date, you should research it in depth before you use it. The following command will re-initialise all the "handlers" OSX knows about and will therefore resolve the issue, it will also likely require you to set up all your custom file associations again. In other words... you do this at your own risk, I do not support this in any way shape or form... The command you will need to run on the terminal is: lsregister -kill Contributing Fork it! Create your feature branch: git checkout -b my-new-feature Commit your changes: git commit -am 'Add some feature' Push to the branch: git push origin my-new-feature Submit a pull request Change Log Version 1.2 - Feature ReleaseFeature: Support additional browsers - added FirefoxDeveloperEdition and Webkit Nightly Build Version 1.1 - Feature ReleaseFeature: Support additional browsers - added Chromium, Canary and SeaMonkey Feature: Only show installed browsers Feature: Indicate which browser is the current default Feature: Added hotkey assignments (to launch workflow, launch with "chrome", and launch with "safari") Improvement: Renamed description in Alfred to simply "Default Browser" Improvement: Improved failure feedback Improvement: Major code refactor to remove duplication and speed up the workflow Improvement: Added an icon to the workflow Improvement: defaultbrowser binary has been updated to better support integrating. This code has been put into a pull request for the official publication of defaultbrowser. Version 1.0 - Initial Release Credits defaultbrowser binary for OSX has been created by Margus Kerma. Margus has been kind enough to permit me to include the binary for defaultbrowser as part of this workflow to make distribution significantly easier. For any issues with the defaultbrowser binary please log these to the official DefaultBrowser Issue Tracker. DefaultBrowser Alfred workflow created by Stuart Ryan. If you would like to get into contact you can do so via: @StuartCRyan on Twitter Stuart Ryan on LinkedIn Technical Notebook Blog License With the exception of the workflow logo, this Alfred Workflow is provided free of charge under the GNU GENERAL PUBLIC LICENSE Version 2 June 1991. The workflow logo is licensed only for use in this workflow and must be changed if the workflow is forked in the future. The workflow logo has been licensed from DepositPhotos to Stuart Ryan. Edited September 9, 2015 by stuartcryan thec13 and vanderholm 2 Link to comment
stuartcryan Posted August 8, 2015 Author Share Posted August 8, 2015 I am happy to say I have pulled together a major update for everyone. I hope there are others out there getting use out of this, if not... I have done a lot of updates for my self *cackles*. Changes are as follows: Feature: Support additional browsers - added Chromium, Canary and SeaMonkey Feature: Only show installed browsers Feature: Indicate which browser is the current default Feature: Added hotkey assignments (to launch workflow, launch with "chrome", and launch with "safari") Improvement: Renamed description in Alfred to simply "Default Browser" Improvement: Improved failure feedback Improvement: Major code refactor to remove duplication and speed up the workflow Improvement: Added an icon to the workflow Improvement: defaultbrowser binary has been updated to better support integrating. This code has been put into a pull request for the official publication of defaultbrowser. Link to comment
stuartcryan Posted September 9, 2015 Author Share Posted September 9, 2015 Hi All, As per a request submitted on Github, I have updated to add support for FirefoxDeveloperEdition and Webkit Nightly Builds to the workflow. New version is 1.2 and is available here --> https://github.com/stuartcryan/defaultbrowser-alfred-workflow/blob/master/set-default-browser-alfred-workflow.alfredworkflow #enjoy thec13 1 Link to comment
ikari Posted May 27, 2016 Share Posted May 27, 2016 Just signed up to congratulate you for this fantastic workflow! Regars. stuartcryan 1 Link to comment
James Hobson Posted September 14, 2016 Share Posted September 14, 2016 @stuartcryanReally useful script - cheers for sharing. Still working well with Alfred v3.1 stuartcryan 1 Link to comment
stuartcryan Posted September 21, 2016 Author Share Posted September 21, 2016 On 15/09/2016 at 3:14 AM, James Hobson said: @stuartcryanReally useful script - cheers for sharing. Still working well with Alfred v3.1 Awesome to hear I have to say it is the most easiest one that I maintain LOL. Link to comment
stuartcryan Posted September 21, 2016 Author Share Posted September 21, 2016 On 27/05/2016 at 7:42 PM, ikari said: Just signed up to congratulate you for this fantastic workflow! Regars. Thank you kindly! (and apologies for the delayed reply). Stuart Link to comment
bboy Posted December 7, 2016 Share Posted December 7, 2016 Thanks for this great workflow! It works like a charm. I was wondering if it was possible to set the default browser without having to validate with the popup? Link to comment
stuartcryan Posted December 7, 2016 Author Share Posted December 7, 2016 Hi BBoy, Unfortunately due to security limitations in OSX, it is not possible at this time. Cheers, Stuart Link to comment
CharlesR Posted April 28, 2017 Share Posted April 28, 2017 Great workflow! Exactly what I was looking for! Thank you very much! Link to comment
vanderholm Posted July 3, 2017 Share Posted July 3, 2017 My "Change browser" dialog comes up hidden behind open windows. I thought the workflow was broken but this seems a problem at my end. Anyone have the same problem? Link to comment
CincyTriGuy Posted December 2, 2017 Share Posted December 2, 2017 Is there any way to add support for Vivaldi? Link to comment
dood Posted June 17, 2020 Share Posted June 17, 2020 Would it be possible to add support for Brave? 😇 Link to comment
panickat Posted January 5, 2021 Share Posted January 5, 2021 Error. "The workflow you are trying to import is invalid..." Alfred 4.4 [1111] Mac Os Big Sur 11.1 already re-downloaded ty 4 help in advance Link to comment
deanishe Posted January 5, 2021 Share Posted January 5, 2021 Hi @panickat, welcome to the forum. I've just downloaded and installed the workflow and it's valid. Which URL did you download it from exactly? Link to comment
panickat Posted January 5, 2021 Share Posted January 5, 2021 4 minutes ago, deanishe said: Hi @panickat, welcome to the forum. I've just downloaded and installed the workflow and it's valid. Which URL did you download it from exactly? https://github.com/stuartcryan/defaultbrowser-alfred-workflow/blob/master/set-default-browser-alfred-workflow.alfredworkflow?raw=true Link to comment
deanishe Posted January 5, 2021 Share Posted January 5, 2021 Same URL. 3 hours ago, panickat said: Alfred 4.4 [1111] Build 1111 is Alfred 4.0.4, not 4.4. Your version is old and doesn't have the various fixes for Big Sur. Update Alfred to version 4.3. Link to comment
zeitlings Posted November 10, 2021 Share Posted November 10, 2021 It didn't work for me with Brave Browser, so I threw together a replacement. This should handle any browser you configure the workflow to consider: https://github.com/zeitlings/alfred-set-default-browser. Note however, that it is not thoroughly tested. More information in the README. Mr Kenz, ronmolenda@gmail.com, Grug and 1 other 3 1 Link to comment
Grug Posted January 14, 2022 Share Posted January 14, 2022 (edited) Good remplacementy Zeitlings, working well here. 👍 Why don't you post it in a new topic ? https://github.com/zeitlings/a Edited January 14, 2022 by Grug zeitlings and Mr Kenz 2 Link to comment
Mr Kenz Posted February 24, 2022 Share Posted February 24, 2022 Excellent replacement @zeitlings!! ✌️ I've been looking for something that can integrate technically any browser. As @Grug said, you can create a whole new topic for that. It'll be super useful. Great Job! zeitlings 1 Link to comment
snoop182 Posted March 27, 2022 Share Posted March 27, 2022 (edited) Hello, nice idea for workflow, I adapted this for my use case : Chrome is a default for work Safari is my default browser for personal staff When I start my work day I lunch a workflow that start several apps & now sets default browser to Chrome. When my workday is done I lunch a workflow that close/forecquit all apps that I opened during the day & sets default browser to Safari For annoying system pop-up I found this AppleScript that automate closing this shit tell application "System Events" tell application process "CoreServicesUIAgent" tell window 1 tell (first button whose name starts with "HERE INSERT FIRST WORD OF THE POP-UP BUTTON") perform action "AXPress" end tell end tell end tell end tell Maby this will help somebody Have a nice day Edited March 27, 2022 by snoop182 script_edit Link to comment
Mr Kenz Posted January 6, 2023 Share Posted January 6, 2023 On 3/27/2022 at 10:52 AM, snoop182 said: Hello, nice idea for workflow, I adapted this for my use case : Chrome is a default for work Safari is my default browser for personal staff When I start my work day I lunch a workflow that start several apps & now sets default browser to Chrome. When my workday is done I lunch a workflow that close/forecquit all apps that I opened during the day & sets default browser to Safari For annoying system pop-up I found this AppleScript that automate closing this shit tell application "System Events" tell application process "CoreServicesUIAgent" tell window 1 tell (first button whose name starts with "HERE INSERT FIRST WORD OF THE POP-UP BUTTON") perform action "AXPress" end tell end tell end tell end tell Maby this will help somebody Have a nice day Do you mind sharing your workflows that launches your apps at the start of your workday and vice-versa? 🙂 Link to comment
zeitlings Posted January 19, 2023 Share Posted January 19, 2023 Coincidentally, I updated the code and workflow today. After peeking in here and seeing your script, @snoop182, I integrated it as well. Works like a charm! With a few tweaks that is. Here's a version of the script that confirms the default browser switch automatically and can handle most bundle names, regardless of locale: on run set theBrowser to "{query}" set browserComponents to theBrowser's words tell application "System Events" tell application process "CoreServicesUIAgent" tell window 1 set buttonNames to (name of every button) repeat with buttonName in buttonNames repeat with theComponent in browserComponents if (buttonName contains theComponent) then tell (first button whose name contains theComponent) perform action "AXPress" end tell return end if end repeat end repeat end tell end tell end tell end run And thanks @Grug, @Mr Kenz . Perhaps now it deserves its own topic. Link: Set Default Browser v1.1.0 Grug 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now