PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Browser Picker

Open Psychlist1972 opened this issue 4 years ago • 21 comments

Browser picker so you can have rule-based default browsers

This is something I've wanted to write, but just haven't had time to do so. I originally considered this a store app, but I think PowerToys is a much better fit because this is more of a power user thing.

Many of us use multiple browsers so we can keep cookies separate. Most apps, however, want to launch just the default browser. In apps that support it, right now, I have to right-click and copy the URL and then paste it into the browser I want to use. That's clumsy.

Instead, it would be great to be able to set up rules for which browser to open. For example:

  • Links from app <X> (example: Outlook, or VS Code, or Terminal) always open in browser <Y>
  • Links to domain <Z> (example: outlook.com, or localhost) always open in browser <Y>
  • Links from app <X> or domain <Z> always prompt for the browser
  • Would include protocol handling in there as well
  • And you can set a fall-though, which becomes your new effective default browser for when no rules apply. That default may be to prompt.

The browser would be an actual browser on the system, and also options like inprivate/incognito as appropriate.

Proposed technical implementation details

The Browser Picker would be registered as the default browser. It would apply the rules and, if there's a match, open the browser selected. No UI needed in this case.

There would also need to be either a config UI, and/or a well-understood JSON file with the rules.

If no match, the default could be to use a specific browser, or to prompt.

Psychlist1972 avatar Mar 19 '20 20:03 Psychlist1972

You pretty much described - in detail - a wish I have had for quite a long time now.

Probably redundant, but in my words: I use an MS/outlook account for my "business" things (like work, financial stuff et cetera) and a Google/Android account for personal stuff. I also want to use the apps from each company - as much as possible - for the corresponding things. I would like to be able to control the browser for (links to) certain domains/websites. So, having MS Edge as the default browser on my PC, it would be nice if links to a personal list of domains will automatically open in Google Chrome. Or Firefox.

Jay-o-Way avatar Aug 03 '20 20:08 Jay-o-Way

Not a solution, but if there are certain website you often use and would rather open in a non-standard browser, you can turn some of them into a browser-app. That way you can open it from Start menu - or anywhere else.

Jay-o-Way avatar Aug 19 '20 13:08 Jay-o-Way

@gmyx Are you still interested in contributing with the solution you made?

Jay-o-Way avatar Dec 02 '20 14:12 Jay-o-Way

Yes, but it will take a long time to do anything. The current tool is written in VB.Net. A lot of work is needed to convert.

Edit: I am still getting the dev environment set-up.

gmyx avatar Dec 03 '20 00:12 gmyx

Not just the Web Browser, email also (and probably others)...

As an end user, it's great to have a UI/functionality that gives us the ability to select a default app for things like emails, web browsers, videos, music, etc., but there scenarios where there's multiple apps:

  • Web Browser
    • UI Testers have to test the handling of hyperlink to different browsers.
    • MS Teams runs apps like MS Planner and OneNote within MS Teams, with the ability to "Open in Browser", I use Edge for displaying Office/Azure stuff and Chrome for software development
    • Edge offers multiple profiles, it would be nice to have choose which profile to run (mm this should probably be a separate feature request). It would be useful for UI Testers:
      • Open in Edge Profile - English
      • Open in Edge Profile - French
      • Open in Edge Profile - Developer
  • Email
    • Since the pandemic, more and more people are working from home and their PC is used for personal and for work. Clicking on a "send email" button from an app would be work vs personal related.

patware avatar Jan 11 '21 17:01 patware

Check out this solution: https://github.com/mortenn/BrowserPicker by Morten Nilsen

Would make a great additional to PowerToys 😀

daltskin avatar Feb 05 '21 11:02 daltskin

@daltskin Morten's project is a good start, for sure. Thanks for bringing it up here :)

Psychlist1972 avatar Feb 05 '21 17:02 Psychlist1972

  • Since the pandemic, more and more people are working from home and their PC is used for personal and for work. Clicking on a "send email" button from an app would be work vs personal related.

People should keep work and private things apart as much as possible. Separate Windows accounts would be ideal.

Jay-o-Way avatar Feb 05 '21 17:02 Jay-o-Way

@gmyx How's your project coming along, if you don't mind me asking? :)

Jay-o-Way avatar Feb 02 '22 18:02 Jay-o-Way

@crutkas , @Jay-o-Way , cc @gmyx

I would love to work on this power toy, if currently none are working on this.

I already have done a similar project - Hurl. Supports a few of the features from mentioned projects.

U-C-S avatar Apr 26 '22 22:04 U-C-S

@crutkas , @Jay-o-Way , cc @gmyx

I would love to work on this power toy, if currently none are working on this.

I already have done a similar project - Hurl. Supports a few of the features from mentioned projects.

@U-C-S I have seen your Hurl project, nice one and I have some additional request, for example ability to pick different Chrome profiles automatic instead of having them in a setup file. Anyway it would be nice to have everything inside this Powertoys app instead. So I would love to help out on this :-)

thellMa avatar Nov 12 '22 09:11 thellMa

for example ability to pick different Chrome profiles automatic instead of having them in a setup file

Yeh, Im currently working on that for Hurl

About this powertoy, Im still open to work on it, I was previously waiting for maintainer's reply (and my laptop upgrade, which is done recently). For now, I'll experiment with this repo and see if integration with Hurl is directly feasible with minimal code modifications (im very new to this and wpf stuff)

U-C-S avatar Nov 12 '22 09:11 U-C-S

Hi @U-C-S I'm sorry we have missed your offer for collaboration. I will add @jaimecbernardo and @crutkas

Aaron-Junker avatar Nov 12 '22 10:11 Aaron-Junker

It's actually harder than you think, especially if you want to detect browser profiles of different browsers, and not just the browsers themselves. Add massive implementation differences between Chrome-based ones, Firefox etc. Try https://www.aloneguid.uk/projects/bt/

aloneguid avatar Nov 21 '22 16:11 aloneguid

I found these similar (closed-source) utilities today, maybe they'll be helpful for the folks implementing this feature.

  • https://switchbar.com/en/
  • https://choosy.app/

ShowMeBillyJo avatar Feb 06 '23 16:02 ShowMeBillyJo

@crutkas @jaimecbernardo have you contacted @U-C-S ? If not, please do.

Jay-o-Way avatar Feb 06 '23 20:02 Jay-o-Way

Looking at Hurl from @U-C-S . Thanks for the collaboration proposal. Looks like it's basically setting itself up as the default browser in the machine. I suppose this could be a PowerToys where when enabling, it would set itself as a selectable browser (possibly would require user interaction too). @crutkas , is this something that would make sense in PowerToys?

jaimecbernardo avatar Feb 09 '23 10:02 jaimecbernardo

Hi. If you are interested in parsing profiles of chromium based browsers and profiles and containers of firefox based browsers you can check out some source from my repository https://github.com/Browsers-software/browsers

It doesn't have Windows support right now but that part should be same between platforms.

If you are really interested, I'd consider making rust crates just for parsing this info out of popular browsers, so everybody benefits. Not sure if you want to integrate with rust though.

Cheers, Madis

liias avatar Feb 23 '23 21:02 liias

I would LOVE this! I do work for my primary company, and also for our sister-company. Each company has it's own TFS/AzureDevOps account. But whenever I click a notification link in a TFS email, it always wants to go to the default browser (of course).

However I use different browsers for each company, like stated above, for keeping cookies/logins separate, so I don't need to keeping logging out of one and then into the other.

It would be amazing to be able to set up system-level rules like

  • if URL matches "https://company1.visualstudio.com/*" then open in Firefox
  • if URL matches "https://company2.visualstudio.com/*" then open in Edge

eidylon avatar Mar 09 '23 19:03 eidylon

@eidylon BT already does this. And it's operating at 6mb ram and 0% CPU. https://www.aloneguid.uk/projects/bt/

aloneguid avatar Mar 09 '23 19:03 aloneguid

@U-C-S

I would love to work on this power toy, if currently none are working on this.

I already have done a similar project - Hurl. Supports a few of the features from mentioned projects.

Hurl looks beautiful! And with the addition of the auto-launch rules you're currently working on, it sounds like it would already be the perfect drop-in for this tool-request. Just bring it inline with whatever PT common code is needed, and BAM - Done! 😎

eidylon avatar Mar 10 '23 17:03 eidylon

+1

vvirtues avatar Dec 02 '23 00:12 vvirtues

This applies to files too. If I have multiple image editors/viewers installed I would like to be able to configure rules based on the image file path. I use 'Always Ask` app that I wrote myself. It currently does not have rules and only works with web links. I plan to extend it to all files when I have time.

nvmkpk avatar Dec 02 '23 02:12 nvmkpk

+1

hrvojegolcic avatar Jul 28 '24 13:07 hrvojegolcic