Coder Social home page Coder Social logo

browserpicker's Introduction

Browser Picker

A default browser replacement for windows to let you pick your preferred browser on the fly or in accordance with your own rules.

Screenshot of browserpicker with three options, of which 2 are running and 1 is not

You can easily configure it to use Firefox for github.com and slashdot.org, but leave Edge to handle microsoft.com
and even let Internet Explorer handle that old internal LOB app you'd rather not use but must.

Installation

You can find the latest release on github.

Default browser

To enable the browser picker window, you need to set Browser Picker as your default browser.

.NET Runtime dependent binary

BrowserPicker.msi and Bundle.zip are JIT compiled and require you have the .NET 8 runtime installed.

Native image generation

As part of installation, BrowserPicker.msi will execute ngen to build a native image for your computer.
This significantly enhances launch times for he executable.
If you prefer the bundle, you may run ngen install BrowserPicker.exe to get the same benefit.

Portable binary

If you do not want to have the .net runtime installed on your computer, you may download the Portable version, which includes the runtime.

BrowserPicker-Portable.msi and Portable.zip contain a win-x64 binary executable with embedded .NET runtime.
This makes the file sizes quite significantly larger, but you do not need an additional runtime to use these.

Signing certificate

To avoid warnings about unknown publisher, you may import the provided certificate into your certificate store first.

Manual steps

You need to open the settings app from the start menu, navigate into Apps, select Default apps, then change the Web browser to BrowserPicker.
Please ensure BrowserPicker can be started before you do this.

Usage

When you open a link outside a browser, one of these things will happen, in order:

  1. If you have previously selected Always ask, the browser selection window is shown.
  2. If you have set up a configuration rule matching the url being opened, the selected browser will be launched with the url.
  3. If you only have one browser running, the link will be opened in that browser.
  4. If you have configured a default browser, it will be asked to open the url.
  5. Otherwise, you will be presented with a simple window asking you which browser you want to use.

The url is shown at the top of the window, and if it matches a list of known url shorteners, BrowserPicker will expand this address and show you the real one after a short delay. If you do not want BrowserPicker to perform this operation (it will call the internet), you may disable this feature in the settings.

Copy url

You can click the clipboard icon at the top to copy the url without opening it

Edit url

You can click the pencil icon at the top of the window to edit or copy the url before visiting it or cancelling:

Screenshot of truncated url being edited Screenshot of updated url in window

Keyboard shortcuts

When this window is open and has focus, you can use the following keyboard shortcuts:

[enter] or [1] Pick the first browser in the list

[2] Pick the second browser in the list

...

[9] Pick the ninth browser in the list

If you keep [alt] pressed while hitting one of these, the browser will be opened in privacy mode.

[esc] Abort and close window

If you click outside the window such that it loses focus, it will close without opening the url in any browser.

Each browser that supports it, has a blue shield button on the right side. Browsers currently supporting privacy mode are firefox, internet explorer, chrome, and edge.

Currently running browsers will have their name in bold, whilst browsers not currently running will have their names in cursive.

As you use the application, it keeps count of how many times you selected each browser. This information is used to show you your browsers in your preferred order automatically.

At the bottom of the window, there is a checkbox to enable "always ask" and a hyperlink to open settings.

Settings

By simply launching BrowserPicker from the start menu or double clicking the BrowserPicker.exe file, you will be presented with a GUI to configure the behaviour. The configuration is saved in the Windows registry: HKEY_CURRENT_USER\Software\BrowserPicker, if you ever need to manually edit it or make a backup.

Screenshot of the browser configuration interface with three browsers

Browsers

The browser list shows you the browsers BrowserPicker has been configured or detected to use.

Disabling browsers

You can disable a browser by clicking Enabled, this will hide the browser from the selection list.

Screenshot of a red hyperlink saying Disabled

Removing browsers

If you click the red X, you may remove a browser.

Do note that if it was automatically detected, it will return to the list the next time auto configuration is performed.

Automatic configuration

The Refresh broser list function gets automatically executed in the background when you use BrowserPicker. This helps it discovering newly installed browsers, in case a new browser has been installed,

Manually adding browser

You may click the hyperlink Add browser to open a popup where you may manually add a browser that has not been detected - or some other tool that isn't a browser.

You can click the buttons behind the input boxes to bring up the file picker interface of windows to select the executable or icon file you want to use.

Screenshot of user interface for entering parameters for a new browser Screenshot of filled user interface

List of configured browsers including notepad as an option

If you browse for the command first, the application will assume the executable also has an icon, and prefill that box.

The name of the application will be attempted to be set automatically based on information in the executable.

Chrome profiles

Tip for Chrome Users: If you are using multiple Chrome profiles, by default if you choose Chrome it will launch in the last profile you launched Chrome with. To make it possibe for browser picker to select a profile you can create a new browser for each profile, set the program to the chrome executable, and add a command line argument to specify which profile to launch: --profile-directory=Default for the first profile, --profile-directory="Profile 1" for the second profile, and so on.

Please note that arguments with spaces do require "" around them to be properly passed to chrome.

Firefox profiles

Similar configuration should be possible for firefox.

Behaviour

This tab contains various settings that govern how BrowserPicker operates.

Screenshot of all the options under the behaviour tab

[ ] Turn off transparency

This will make BrowserPicker have a simple black background, to help with legibility

[ ] Always show browser selection window

This option is also available on the browser selection window. When enabled, BrowserPicker will always ask the user to make a choice.

[ ] When no default is configured matching the url, use: [__v]

When configured, BrowserPicker will always use this browser unless a default browser has been configured for that url.

[ ] Always ask when no default is matching url

This option makes it so BrowserPicker will only pick matched default browsers and otherwise show the selection window.

[ ] Disable url resolution

[ ] Ignore defaults when browser is not running

When enabled, configured default browsers only apply when they are already running.

[ ] Update order in browser list based on usage

This option will make your list of browsers automatically sorted by how often you pick them.

[ ] Disallow network activity

BrowserPicker may perform DNS and HTTP calls to probe the specified url in order to check if the url redirects elsewhere.
This option turns this feature off, preventing BrowserPicker to call the network when you launch a url.

URL resolution timeout: [_____]

You may adjust for how long BrowserPicker attempts to resolve an url here.

Defaults

The defaults tab lets you configure rules to map certain urls to certain browsers.

Illustration of the empty list of default browser choices

Match types

There exists four different match types, but you cannot use Default, that is reserved for use elsewhere.
The option will eventually get hidden in the interface, but for now it becomes Hostname when selected.

Illustration of a dropdown showing the four match types Hostname, Prefix, Regex and Default

Hostname match

The pattern will match the end of the hostname part of the url, ie. hub.com would match https://www.github.com/mortenn/BrowserPicker, but not https://example.com/cgi-bin/hub.com

Prefix match

The pattern will match the beginning of the url, ie. https://github.com/mortenn would match https://github.com/mortenn/BrowserPicker but not https://www.github.com/mortenn/BrowserPicker

Regex match

The pattern is a .NET regular expression and will be executed against the url, see .NET regular expressions for details.

Browser

The selected browser will be the one to launch for matched urls.

Illustration of a dropdown showing each browser icon

Test defaults

There is even a handy dandy tool for verifying your settings,
just paste that url into the big white text box and get instant feedback on the browser selection process:

Example of the test defaults interface in use

browserpicker's People

Contributors

arkady-marchenko avatar daltskin avatar dependabot[bot] avatar deryb avatar dobesv avatar mortenn avatar stuartleeks 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

browserpicker's Issues

Handle spaces in URL

When user is opening a local html file with a space in the path, the url is mangled as it is handed off to the browser

Always On Top Option

I often find myself losing track of the browser picker window after it appears. While it can always be alt-tabbed to, it doesn't have a task bar presence, so it can get lost if you click away to another window after you open it. Additionally, in some cases it'll actually open itself behind the current window you're in (click a link in the VS Code powershell terminal seems to do this).

It'd be nice if there was an option to keep the window on top no matter what. In theory, you're going to want to select a browser immediately after opening the program, so I can't really think of a scenario in which you wouldn't want it right in front of you.

Disabled browsers still affect logic deciding if user should pick browser

Scenario:

  • One browser is disabled in settings
  • The disabled browser is running
  • One non-disabled browser is running
  • The user clicks a link

Currently, this shows the browser picker window, without the disabled browser shown.
In this scenario, the browser picker should not show unless the "always show" option is enabled.

Handle Teams links

Links from Microsoft Teams have 'safe link' handling, e.g. https://staticsint.teams.cdn.office.net/evergreen-assets/safelinks/1/atp-safelinks.html?url=https%3A%2F%2Fregistry.terraform.io%2Fproviders%2Fhashicorp%2Fazurerm%2Flatest%2Fdocs%2Fresources%2Fprivate_dns_zone_virtual_network_link&locale=en-gb...... which breaks default rules.

It would be great to decode the Teams link to display and use the underlying link for default rules.

Rebuild for .NET 5/6

Move over to .NET 5 or 6 to at least enable cross platform on paper, after Win32 calls have been isolated.

Allow default to match more than hostname

I have some sites that I use where matching on the hostname isn't sufficient. For example, with Azure DevOps the URLs are https://dev.azure.com/org1/..., https://dev.azure.com/org2/... and I want to be be able to direct each to a different browser.

Would you be open to a PR that added the ability to match on (for example) the full prefix of the URL rather than suffix match on the hostname? Or maybe regex matches?

[1.8.2] Launching Throws Exception

When I open any link using the new release, 1.8.2, I get the following exception in a message box:

---------------------------

---------------------------
Value cannot be null.

Parameter name: name   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)

   at Microsoft.Win32.RegistryKey.ValidateKeyName(String name)

   at Microsoft.Win32.RegistryKey.CreateSubKeyInternal(String subkey, RegistryKeyPermissionCheck permissionCheck, Object registrySecurityObj, RegistryOptions registryOptions)

   at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, Boolean writable)

   at BrowserPicker.Configuration.Config.SetBrowsers(IEnumerable`1 browsers)

   at BrowserPicker.ViewModel.FindBrowsers()

   at BrowserPicker.ViewModel.Initialize()

   at BrowserPicker.App.<OnStartup>d__2.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

   at System.Windows.Threading.DispatcherOperation.InvokeImpl()

   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Windows.Threading.DispatcherOperation.Invoke()

   at System.Windows.Threading.Dispatcher.ProcessQueue()

   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)

   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)

   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

   at System.Windows.Application.RunDispatcher(Object ignore)

   at System.Windows.Application.RunInternal(Window window)

   at BrowserPicker.App.Main()
---------------------------
OK   
---------------------------

Downgrading to 1.7.1 restores functionality.

Right click option in browser to open in other browsers.

When right clicking on a link in a browser it should have the option "Open link in ....". (Navigates to link but in different browser)

When right clicking on any tab/window "Open in .....". (Duplicates current tab/window but in a different browser)

I have a feeling this may require a browser extension, but here's hoping it won't.

Run without installer

I would like to run BrowserPicker without register it into Program list at Windows' Control Panel. Is it possible to develop or release a (portable?) version without installer?

Thank you!

Support Private Browsing for Microsoft Edge

In #6 (Support incognito mode) you said

edge does not support this. https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/9245247-inprivate-command-line-switch

However, there's an option to open a "New InPrivate window" in MS-Edge's Jump List, so I searched around and found that it can be launched in private mode via the command line by running

start shell:AppsFolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge -private

and I've tested and found that you can add a url on the end of that (don't put it in quotes though), so if you want to launch MS Edge in an InPrivate window and go to this project on GitHub BrowserPicker should execute it like

shell:AppsFolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge -private https://github.com/mortenn/BrowserPicker

Add ability to edit URL.

Add ability to edit URL before opening. It would help to clear referrer and to copy to clipboard.

Per-user installed browsers are not detected

The current browser scan logic only detects system-wide browsers.
If a user has, say, firefox or chrome installed to their profile, the browser is not available to pick automatically.

Backport the «Copy URL» feature to 1.7

This would be very useful, because sometimes you need just the link (for example, when some buttons in some apps try to open a link), but don't want to open your browser.

I don't plan to update to new versions anyway, because new versions require .NET 4.8 and I don't want to install it, so I'll keep using version 1.7.0. For other people that want to use old version but still want a way to copy URL to clipboard, here's the workaround:

Create a batch script (any text file with «.bat» as the extension) and paste this line: echo | set /p dummyName="%~1" | clip

Optionally, find any .png icon that symbolizes copying for you. You might need to change DPI so that icon is about 1 cm both vertically and horizontally.

Use the «Add browser» button to add your script as URL handler to BrowserPicker, use your icon as image, add any name you like. Worked for me on Windows 10 LTSC.

Always show window on first startup after being installed

Yes, that's the expected behavior, but probably it's not what everyone wants.

So I found the BrowserPicker a few minutes ago and wanted to at least look at it, but I had my browser open with some livestreams going etc., so I didn't want to close my browser yet. Double clicking the executable doesn't work either.

Had to look at the code to figure out how to do this, so I found a workaround:

I made a new DWORD (32 bit) value that is set to 1 in HKEY_CURRENT_USER\Software\BrowserPicker .

Can we please make some FAQ section to readme or add wiki for the project and mention this somewhere? Or even better, explain all registry keys that BrowserPicker uses.

Need to auto-detect new browsers at some interval

After upgrading to the new edge browser in windows, it does not automatically appear in BrowserPicker, needing the user to manually intervene.

I do not want to run the detection code on every single startup, so maybe save a timestamp for when to do it next?

Single click privacy mode

Rather than having a checkbox, make a separate button on each browser option to launch it in privacy mode, so the user only needs to do one click.
Using 1-9 with the alt button pressed could activate privacy mode for accessibility.

Background scan for browsers on each run

The registry scan isn't very expensive, so might as well start it on launch, with a delay and let it run in the background.
This way, if the user expects a browser but don't see it, because they just installed it, it would appear like magic after a couple seconds so long as they don't make a selection.

JSON based configuration

After Win32 has been abstracted out, may as well build a separate backend for doing configuration in a .json file
This file should be saved somewhere in the users home folder.
For Windows, the appropriate location would be in AppData/Roaming

Microsoft Edge private mode not displayed.

Microsoft Edge private mode button isn't displayed.
What I've tested is this works:
public string PrivacyArgs { get { switch (Name) { .... case "Microsoft Edge": return " -inprivate "; ....

Multiple Profile support in Chrome

Had a look at the new release and it looks real nice! Was wondering if there's any chance of support for multiple Chrome profiles in future versionsa?

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.