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, 2:47 pm
  • 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

Last post Author Topic: IDEA: Choose which browser will open a url from external app  (Read 24846 times)

JTuttle

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
I am looking for a program that will prompt the user to choose a browser from a customized list when a url, html file, or anything else normally opened in a browser is launched.
This is similar to BrowserTraySwitch (https://www.donation...owsertray/index.html) but this will prompt upon execution of a link.

Example: AIM executes a url, a window pops up listing the browsers I have chosen (Internet Explorer, Firefox, Opera, etc.), I choose Firefox, and Firefox is opened with the url from AIM.

Thank you,
Jonathan
« Last Edit: June 24, 2007, 12:59 AM by JTuttle »

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: Choose which browser will a url from external app
« Reply #1 on: June 23, 2007, 08:14 AM »
personally i think this is a nice idea.. essentially it's like a url-launching "proxy".
it wouldn't be too hard to do, you basically need to write a small program that registers itself as the default browser -- then it will get called to open urls.  then it's job would simply be to ask user (or use some rules to decide) which actual browser to launch with th eurl.

mikiem

  • Participant
  • Joined in 2006
  • *
  • default avatar
  • Posts: 99
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will a url from external app
« Reply #2 on: June 23, 2007, 10:48 AM »
FWIW I think that this would be especially useful for printing...

I do a lot of web page printing to PDF Creator, often off of links in email... While I prefer Firefox, IE very often does a far superior job of handling images. Unfortunately many emails do not use plain text or html links so cut and paste doesn't work -- have to open the link in the default browser [in my case Firefox], then copy/paste the link into ie [or put up with the crappy picture].

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: Choose which browser will a url from external app
« Reply #3 on: June 23, 2007, 10:52 AM »
it would also be extremely useful if you can say that certain urls (or urls open from certain programs) can launch the configured browser you've already set (without prompt), while others prompt you and let you cancel.  kind of like a browser opening firewall.

i hope here someone will write this.

JTuttle

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #4 on: June 24, 2007, 12:58 AM »
thank you, mouser, I forgot to mention about cancelling a url that an app wants to open.
and I just noticed that in the title of this post I forgot the word "open"

steeladept

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,061
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #5 on: June 24, 2007, 05:34 AM »
it would also be extremely useful if you can say that certain urls (or urls open from certain programs) can launch the configured browser you've already set (without prompt), while others prompt you and let you cancel.  kind of like a browser opening firewall.

i hope here someone will write this.
:-* LOVE :-* this idea.  I have many pages that I must open in IE because of the way it is made or, in at least one case, because of the application running to create the page (sharepoint portal).  It just won't open in Firefox without using one of the engine converters (which have their own issues on my machine).

If I can define and set specific URL's to open a new page in IE right out of the application in use at that time (usually Firefox), that would be awesome.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #6 on: April 02, 2009, 07:48 PM »
If FARR could register as the default browser, would this idea be implementable as a FARR plugin? ;)

cyberdiva

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,041
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #7 on: April 02, 2009, 09:13 PM »
If I can define and set specific URL's to open a new page in IE right out of the application in use at that time (usually Firefox), that would be awesome.

I should mention that this is possible with the bookmark manager I use, Linkman.  You can set certain bookmarks to open with a specific browser regardless of what your default browser is, and you can also right-click on any bookmark and choose on the fly the browser in which it should open.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #8 on: April 08, 2009, 01:11 PM »
 :) Try RunIn!

Shows a list of programs to choose to open associated file types in.

Just compile it and associate the file types you want to control with the compiled exe.

The first time it is run, it creates an ini-file with a list of the programs to choose from. Just edit this file to suit your needs.

It's just an early draft, just test it and see if you can use it.

Skrommel


;RunIn.ahk
; Shows a list of programs to choose to open associated file types in
;Skrommel @ 2009

#NoEnv
#SingleInstance,Force
SetBatchLines,-1

applicationname=RunIn

INIREAD:
IfNotExist,%applicationname%.ini
{
ini=
(
[1]
name=Notisblokk
exepath=C:\Windows\Notepad.exe
workfolder=
parameters=
iconpath=
iconnumber=

[2]
name=WordPad
exepath=C:\Programfiler\Windows NT\Tilbehør\wordpad.exe
workfolder=
parameters=
iconpath=
iconnumber=

[Settings]
)
FileAppend,%ini%,%applicationname%.ini
ini=
}

; Create the ListView and its columns:
Gui,+ToolWindow +AutoSize +Resize
Gui, Add, ListView, x0 y0 vlistview GLISTVIEW AltSubmit, Name|Program|WorkFolder|Parameters
LV_ModifyCol(3, "Integer")  ; For sorting, indicate that the Size column is an integer.

; Create an ImageList so that the ListView can display some icons:
ImageListID1 := IL_Create(10)
ImageListID2 := IL_Create(10, 10, true)  ; A list of large icons to go with the small ones.

; Attach the ImageLists to the ListView so that it can later display the icons:
LV_SetImageList(ImageListID1)
LV_SetImageList(ImageListID2)

; Ensure the variable has enough capacity to hold the longest file path. This is done
; because ExtractAssociatedIconA() needs to be able to store a new filename in it.
VarSetCapacity(Filename, 260)
sfi_size = 352
VarSetCapacity(sfi, sfi_size)

; Gather a list of file names from the selected folder and append them to the ListView:
GuiControl, -Redraw, listview  ; Improve performance by disabling redrawing during load.
Loop
{
  IniRead,name,%applicationname%.ini,%A_Index%,name
  IniRead,exepath,%applicationname%.ini,%A_Index%,exepath
  IniRead,workfolder,%applicationname%.ini,%A_Index%,workfolder
  IniRead,parameters,%applicationname%.ini,%A_Index%,parameters
  IniRead,iconpath,%applicationname%.ini,%A_Index%,iconpath
  IniRead,iconnumber,%applicationname%.ini,%A_Index%,iconnumber
  If (exepath="" Or exepath="ERROR")
  {
    GuiControl, +Icon, listview    ; Switch to icon view.
    GuiControl, +Redraw, listview  ; Improve performance by disabling redrawing during load.
    Gui,Show
    Return
  }
  If (name="" Or name="ERROR")
    SplitPath,exepath,name
  If (parameters="ERROR")
    parameters=
  If (iconpath="" Or iconpath="ERROR")
    iconpath:=exepath
  FileName:=iconpath  ; Must save it to a writable variable for use below.

  ; Build a unique extension ID to avoid characters that are illegal in variable names,
  ; such as dashes.  This unique ID method also performs better because finding an item
  ; in the array does not require search-loop.
  SplitPath, FileName,,, FileExt  ; Get the file's extension.
  If FileExt in EXE,ICO,ANI,CUR
  {
    ExtID := FileExt  ; Special ID as a placeholder.
    IconNumber = 0  ; Flag it as not found so that these types can each have a unique icon.
  }
  Else  ; Some other extension/file-type, so calculate its unique ID.
  {
    ExtID = 0  ; Initialize to handle extensions that are shorter than others.
    Loop 7     ; Limit the extension to 7 characters so that it fits in a 64-bit value.
    {
      StringMid, ExtChar, FileExt, A_Index, 1
      If not ExtChar  ; No more characters.
        break
      ; Derive a Unique ID by assigning a different bit position to each character:
      ExtID := ExtID | (Asc(ExtChar) << (8 * (A_Index - 1)))
    }
    ; Check if this file extension already has an icon in the ImageLists. If it does,
    ; several calls can be avoided and loading performance is greatly improved,
    ; especially for a folder containing hundreds of files:
    IconNumber := IconArray%ExtID%
  }
  If Not IconNumber  ; There is not yet any icon for this extension, so load it.
  {
    ; Get the high-quality small-icon associated with this file extension:
    If Not DllCall("Shell32\SHGetFileInfoA", "str", FileName, "uint", 0, "str", sfi, "uint", sfi_size, "uint", 0x101)  ; 0x101 is SHGFI_ICON+SHGFI_SMALLICON
      IconNumber = 9999999  ; Set it out of bounds to display a blank icon.
    Else ; Icon successfully loaded.
    {
      ; Extract the hIcon member from the structure:
      hIcon = 0
      Loop 4
        hIcon += *(&sfi + A_Index-1) << 8*(A_Index-1)
      ; Add the HICON directly to the small-icon and large-icon lists.
      ; Below uses +1 to convert the returned index from zero-based to one-based:
      IconNumber := DllCall("ImageList_ReplaceIcon", "uint", ImageListID1, "int", -1, "uint", hIcon) + 1
      DllCall("ImageList_ReplaceIcon", "uint", ImageListID2, "int", -1, "uint", hIcon)
      ; Now that it's been copied into the ImageLists, the original should be destroyed:
      DllCall("DestroyIcon", "uint", hIcon)
      ; Cache the icon to save memory and improve loading performance:
      IconArray%ExtID% := IconNumber
    }
  }

  ; Create the new row in the ListView and assign it the icon number determined above:
  LV_Add("Icon" . IconNumber, name, exepath, workfolder, parameters)
}
GuiControl, +Redraw, listview  ; Re-enable redrawing (it was disabled above).
LV_ModifyCol()  ; Auto-size each column to fit its contents.
LV_ModifyCol(3, 60) ; Make the Size column at little wider to reveal its header.
Return


LISTVIEW:
If A_GuiEvent = Normal  ; There are many other possible values the script can check.
{
  LV_GetText(name, A_EventInfo, 1)  ; Get the text of the first field.
  LV_GetText(exepath, A_EventInfo, 2)  ; Get the text of the second field.
  LV_GetText(workfolder, A_EventInfo, 3)
  LV_GetText(parameters, A_EventInfo, 4)
  Run,%exepath% "%1%" %parameters%,%workfolder%, UseErrorLevel
  If ErrorLevel
    MsgBox,Could not open "%exepath%.
  ExitApp
}
Return


GuiSize:  ; Expand or shrink the ListView in response to the user's resizing of the window.
If A_EventInfo = 1  ; The window has been minimized.  No action needed.
  Return
; Otherwise, the window has been resized or maximized. Resize the ListView to match.
GuiControl, Move, listview, % "W" . (A_GuiWidth) . " H" . (A_GuiHeight)
Return


GuiClose:
ExitApp
« Last Edit: April 08, 2009, 01:35 PM by skrommel »

sri

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 689
    • View Profile
    • Sridhar Katakam
    • Read more about this member.
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #9 on: September 15, 2009, 01:45 AM »
I need a way to specify the browser that will handle the opening of URLs per application.

For example I want all links in outlook to be opened in Maxthon where as links in other applications should continue to be opened w/ my default browser, Firefox.

Possible?
<a href="https://sridharkatakam.com">My blog</a>

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #10 on: September 15, 2009, 06:04 AM »
take a look at Browser Chooser.

sri

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 689
    • View Profile
    • Sridhar Katakam
    • Read more about this member.
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #11 on: September 15, 2009, 06:22 AM »
Thanks for the suggestion lanux. But I don't want to be provided an option to choose the browser every time a link is clicked. I am wondering if it's possible to specify application-specific browser.
<a href="https://sridharkatakam.com">My blog</a>

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #12 on: September 15, 2009, 08:00 AM »
you can forward your suggestions to the developer of "browser chooser". since he's currently working on the project, it's worth a try.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #13 on: September 19, 2009, 06:31 PM »
I need a way to specify the browser that will handle the opening of URLs per application.

For example I want all links in outlook to be opened in Maxthon where as links in other applications should continue to be opened w/ my default browser, Firefox.

Possible?

If you've done any batch programming or are game to try it, you could probably code a few lines in AutoIt3.  There are forums where you can get help here:
http://www.autoitscr...com/forum/index.php?

The AutoIt3 tools are free.  Once you debug your script you can compile it to .exe.
The easiest way would be to set a hotkey.  Select your link or copy to clipboard and hit the hotkey.  The app would check the active window title to see if it matches apps in your list.  The pseudo code would be something like:
If active window title has "outlook" use browser a
else if active window title has notepad use browser b etc..

If you want to launch the link normally and have an .exe intercept it then you'd have to make it the default browser and that's a can of worms you probably don't need.  The hotkey scheme is the easiest.

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: Choose which browser will open a url from external app
« Reply #14 on: September 19, 2009, 06:34 PM »
it's really about time someone wrote this Proxy Url Handler idea.. it's long long overdue.

let me describe the concept and the main features it needs to be done properly:

  • 1. it needs to register itself as the default url handler, so it gets called every time any program opens up a url.
  • 2. it needs to be take a configuration file that specify rules for what urls get opened in what browsers.
  • 3. these rules need to be able to handle regular expressions on the urls themselves, and refer to the original launching application.


MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #15 on: September 24, 2009, 02:37 PM »
I need a way to specify the browser that will handle the opening of URLs per application.

For example I want all links in outlook to be opened in Maxthon where as links in other applications should continue to be opened w/ my default browser, Firefox.

Possible?

I think I can do the programming part of this pretty easily.  The fly in the ointment, as usual, is the Registry settings.  From searching Browser Chooser in the Registry it looks like there's at least a dozen keys used when he sets the default browser(I don't know if he sets them all or Vista64 sets the "Wow6432Node" stuff itself.. this 64 bit Registry scam is new to me.) I already have a function I use in my HomeFolder program that returns the exe file associated with the active window.  If EditPad is active and you double click on the text "www.favessoft.com" and it opens the URL with the default browser, it's no big deal for my program to know it's EditPad and choose the browser you set up in settings.  But it's getting Windows to launch my program without breaking anything in the Registry that requires some research.

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: Choose which browser will open a url from external app
« Reply #16 on: September 24, 2009, 02:39 PM »
Miles, I can help -- email me for a master list of default-browser registry settings that i've come across in building BrowserTraySwitch ([email protected])

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #17 on: September 24, 2009, 04:09 PM »
Will do. :)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #18 on: September 25, 2009, 12:51 PM »
Sorry, but at the moment it seems like going directly to the desired browser depending on which app launched the url would be a natural progression for the Browser Chooser program.  Messing with the registry on my machines is just an invitation for them to start acting weird.  I would agree with lanux that a feature request probably makes the most sense.  All the Browser Chooser has to do is get the title of the active window and if it's in the list of settings, not bring up his toolbar.  Just pass the url on to the browser in the settings.  No sense reinventing the wheel when the Browser Chooser wheel already looks pretty good to me. :)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #19 on: September 26, 2009, 04:26 PM »
btw I went to Browser Chooser site.  Turns out it's Open Source.  I don't have VB.NET installed, but if someone is into Visual Basic for .NET it should be a fairly straight-forward modification to add options to associate a bunch of window title strings with each browser in the toolbar.

Probably in the OnLoad handler for the main form, before the focus is removed from the current app, get the window title of the active window. If in the options list, launch the chosen browser with the url instead of bringing up the toolbar.

It looks like the project is originally from around 2004 so I'm not sure if it would automatically load and be valid with a newer VB.NET.  Contacting the author may be a good idea before investing too much time in it.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #20 on: September 27, 2009, 06:22 AM »
Probably in the OnLoad handler for the main form, before the focus is removed from the current app, get the window title of the active window. If in the options list, launch the chosen browser with the url instead of bringing up the toolbar.

yes, the program has already a way to monitor the urls being clicked so i guess it wouldn't be hard for the author to do some parsing and pass the urls as parameters for different browsers based on users' preference.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #21 on: September 27, 2009, 11:27 AM »
I posted the suggestion in Browser Chooser forum.  Here's the link:
http://browserchoose....aspx?ThreadId=70255

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #22 on: September 27, 2009, 11:47 AM »
I posted the suggestion in Browser Chooser forum.  Here's the link:
http://browserchoose....aspx?ThreadId=70255

nice work, Miles.. you got the ball rolling. :up:

sri

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 689
    • View Profile
    • Sridhar Katakam
    • Read more about this member.
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #23 on: September 28, 2009, 12:45 PM »
Request those who are interested in this to vote for it at http://browserchoose...aspx?WorkItemId=2597
<a href="https://sridharkatakam.com">My blog</a>

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: IDEA: Choose which browser will open a url from external app
« Reply #24 on: September 28, 2009, 01:11 PM »
Request those who are interested in this to vote for it at http://browserchoose...aspx?WorkItemId=2597

on my way now..