topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 4:27 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: rule-based browser chooser  (Read 3776 times)

ayryq

  • Supporting Member
  • Joined in 2009
  • **
  • Points: 101
  • Posts: 290
    • View Profile
    • Donate to Member
IDEA: rule-based browser chooser
« on: November 03, 2010, 06:09 PM »
I've been kicking around an idea for a rule-based browser chooser. The idea is, it becomes the default browser, and when it receives a link it launches the "real" browser you wish based on a set of rules which you define.

If it launched quick enough it wouldn't even have to stay resident - it could open, fire the link to the right browser, and then close.

Here's some thoughts:

should be able to define arbitrarily many commands and arguments (e.g. chrome, firefox, chrome privacy, chrome full-screen, etc.)
should work on arbitrarily many rules
should be able to prioritize rules
should be able to set itself up as the default browser even in windows 7
   corollary: should be able to unset itself too!

rules
should be able to detect (and act on) which (if any) browser is already running
should be able to identify (and act on) what program called it
should be able to identify (and act on) the url or portion thereof

I think rules should be in a text format. For some reason I'm picturing something like a procmail recipe.
They'd probably be easier to use, though, if they were creatable in a outlook-like manner.

some example rules

//three low-priority rules for default cases
//use the already-open browser if there is one
//(if I'm working in Chrome, use it!), preferring firefox, otherwise run firefox.
If firefox is running
open url in firefox
priority 100
if chrome is running
open url in chrome
priority 105
if no browser is running
open url in firefox
priority 110

//override default case for specific urls
if url contains "gmail"
open url in chrome
priority 1
if url contains "windowsupdate"
open url in IE
priority 1
if calling program equals feedreader
open url in firefox-new-window-in-background
priority 10
if calling program equals farr
open url in opera
priority 10
   

There's a similar program "BrowserChooser" that sets itself as default, which asks what you want to do every time you click a link. http://browserchooser.codeplex.com/
All the other solutions I found on DC also seem to be based on letting you pick which browser when you click the link through various mechanisms. I bet a rule set could cover almost all cases without user interaction.
I actually use gnu/linux most of the time, and I bet this could be done with a simple bash or perl script, but I don't actually think I'd use it on linux - I use firefox for everything. I use single-purpose browsers more in Windows.
It would sure be nice if it could even intercept links clicked in a browser, but this would probably require an extension for each browser?

Does anyone else think this would be handy? Certainly not worth coding just because I want google voice to open in chrome.

Eric

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: IDEA: rule-based browser chooser
« Reply #1 on: November 03, 2010, 10:28 PM »
i sort of did the 1st part here, you may try that if you want.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: rule-based browser chooser
« Reply #2 on: November 03, 2010, 10:47 PM »
This is an idea i've been so tempted to work on.. though my main idea was regex matching on urls to decide which browser to open the url in.

The thing that has stopped me from implementing it is the "BrowserChooser" application, which is open source and seems to be a great foundation for adding such code.  So unless BrowserChooser is really flawed, i think the best way forward would be for someone to add these functions to that program.