DonationCoder.com Forum

DonationCoder.com Software => Mouser's Zone => Find And Run Robot => Topic started by: joby_toss on February 09, 2010, 01:48 PM

Title: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: joby_toss on February 09, 2010, 01:48 PM
I use Opera as my main browser, but I also need Firefox and Chrome. They all have their strong and week points.

I make, for example, a Google search using "g query" syntax.

Here comes my question: how can I make my web search in the current opened browser and not in the default one?
And if I have all 3 (or only 2) browsers opened, could I specify a preferred order of them?

Maybe this could be doable already, but I have no idea how.
It is annoying to work in Firefox and hitting "g whatever" makes me wait until Opera launches etc...

Thanks!

Edit: the answer was offered by lanux128 in the form of Farr_Browser_Launcher (https://www.donationcoder.com/forum/index.php?topic=21680.msg206064#msg206064).
Title: Re: Make web search in current opened browser
Post by: mouser on February 09, 2010, 02:10 PM
i *think* this is what you want:
[ You are not allowed to view attachments ]
Title: Re: Make web search in current opened browser
Post by: joby_toss on February 09, 2010, 05:14 PM
Oh, no. I know about that option.

Let's say my default browser is Opera and I specified Firefox in that option field you mentioned.
But I work in this moment in Chrome. This is the only opened/started browser. How can I send searches to this opened/started browser (not Opera, not Firefox). Because this is already started and the search will take place quickly. As it is now (in this example), I'll have to wait for Firefox to open (and it takes a very long time since I need a lot of plugins).

Could this be possible? Use the already opened/started browser (no matter what that is, even IE) for searches instead of system's default browser or the one specified in Custom Browser field?

I guess it's not that easy to explain with my current English knowledge. :(
Title: Re: Make web search in current opened browser
Post by: mouser on February 09, 2010, 05:24 PM
ok i understand what you want.

i think the most elegant solution would be by elaborating on an idea we've discussed several times on DC and i am tempted to code -- which would be a standalone web browser middleman.

The browser middleman would be configured in the above screen, with rules specifying which real browser it should send urls to.  in your case you would want it to send the url to whatever browser is already running.  [The main use for this browser middleman idea was to open certain patterned urls in some browsers and others in others, and others blocked, etc. ]
Title: Re: Make web search in current opened browser
Post by: JavaJones on February 10, 2010, 04:03 PM
Not being a FARR expert this may already exist, or there may already have been lengthy discussions about why it's not possible, a bad idea, or whatever... buuut, having said that, what about:

A keyword system to use a specific app to open the result of a search. Could be a suffix, e.g. "g query fx" would use Google to search on the "query" text and the application associated with "fx" (Firefox) to open the result when clicked on/invoked. You could then do "g query ie" and get it to open in ie, or "g query np" for notepad. You'd setup custom keyword associations with apps the same way you apparently can for search types and plugins. Obviously the suffix approach has problems, so maybe it could be an additional prefix, or some other modifier, and then there's the concern that not every result may be able to be opened by said app, but then if you know you're looking for e.g. an HTML file or web URL in your search, then it's reasonable to specify a browser to open it, even if other results come up that could not be opened by a browser - you leave it to the user to decide and deal with the consequences.

It seems like this could be fairly cool and powerful functionality...

- Oshyan
Title: Re: Make web search in current opened browser
Post by: mouser on February 10, 2010, 04:08 PM
A keyword system to use a specific app to open the result of a search.


this exists.

in the help file look up the section: "Advanced Use -> Using Alias Action Keywords"
Title: Re: Make web search in current opened browser
Post by: JavaJones on February 10, 2010, 04:52 PM
I knew it. :D So, can it be used to overcome the issue the OP has, and launch a specific browser for search results?

- Oshyan
Title: Re: Make web search in current opened browser
Post by: lanux128 on May 20, 2010, 07:31 AM
even though Firefox is my default, when Firefox is not open i prefer to open any quick queries launched from Farr in K-Meleon (which is less resource intensive). so for that purpose, i wrote a small AHK script to do just that.

• Farr_Browser_Launcher (FBL4)
to use it, just copy the file into a folder of your choice and refer to that path in your Farr's custom browser option. (see pic)

[ You are not allowed to view attachments ]

please give it a try and let me know if it works or otherwise.. also thanks to ewemoa for his valuable suggestions. :)


Edit: new version uploaded, please give this a try. hopefully the "space" bug have been fixed.
i also shortened the program's name to FBL4 (the 4 stands for the number of supported browsers). :)
Title: Re: Make web search in current opened browser
Post by: joby_toss on May 21, 2010, 01:29 AM
In my case (win7x64) it only works if BrowserB is IE8 (and it always opens a new window instead of a new tab in the already opened instance).
Not FF nor Chrome works, but I guess it is because I use the portable versions (NSIS launchers).

It is pretty amazing what you did here!  :Thmbsup:
Thanks!

Edit: Forgot to say that I started using this tool a while back, Browser Chooser (http://browserchooser.codeplex.com/), but it involves one more mouse click and quite some attention.
Title: Re: Make web search in current opened browser
Post by: lanux128 on May 21, 2010, 01:40 AM
In my case (win7x64) it only works if BrowserB is IE8 (and it always opens a new window instead of a new tab in the already opened instance).
Not FF nor Chrome works, but I guess it is because I use the portable versions (NSIS launchers).

It is pretty amazing what you did here!  :Thmbsup:
Thanks!

i see that you're using win7x64.. in that case, you have to edit the INI file (%FarrDir%\Scripts\Farr_Browser_Launcher.ini) and change the path to your browser accordingly. you can refer to the image below.

[ You are not allowed to view attachments ]

btw, you're welcome and let me know if the change works as i have no win7 to test..  :)
Title: Re: Make web search in current opened browser
Post by: joby_toss on May 21, 2010, 02:02 AM
Hey...I played around a bit with the paths like you suggested and IT WORKS (even with the portable launchers)!
Brilliant!
Thank you so much!

The trick is not to put the default browser in the first spot (BrowserA - Opera in my case).

Can BrowserC , BrowserD etc. be added?

??? I see no mention about chrome in your script and yet, it works with it, too.??? :)
Title: Re: Make web search in current opened browser
Post by: lanux128 on May 21, 2010, 02:14 AM
Hey...I played around a bit with the paths like you suggested and IT WORKS (even with the portable launchers)!
Brilliant!
Thank you so much!

The trick is not to put the default browser in the first spot (BrowserA - Opera in my case).

Can BrowserC , BrowserD etc. be added?

glad to see it working. yes, BrowserA gives way to BrowserB if BrowserB is already open. think A as the default heavyweight slugger while B is the nimble-footed sprinter. :)

as for BrowserC , BrowserD can you give an example of how they would be prioritised? like an order of how and when they should be opened.
Title: Re: Make web search in current opened browser
Post by: lanux128 on May 21, 2010, 02:23 AM
??? I see no mention about chrome in your script and yet, it works with it, too.???

you only need to specify the path in the INI file for the browsers to work. in case the paths do not exist, then the script will look to Internet Explorer (which is available in all versions of Windows) as a fail-safe instead of showing an error message. that's why earlier you had the links opening in IE8. btw, what were the browser paths in win7x64?
Title: Re: Make web search in current opened browser
Post by: joby_toss on May 21, 2010, 02:36 AM
The main priority should be: is it opened (only 1)? use it!

If none opened: use A.
If 2 opened: if A and B or C or D - use A
                    if B and C or D - use B
                    if C and D - use C
If 3 opened: if A and any 2 other - use A
                    if B and C and D - use B
If all opened - use A.

As for browsers paths, in my case, here they go:
- installed:   IE8x86 - C:\Program Files (x86)\Internet Explorer\iexplore.exe
                 IE8x64 - C:\Program Files\Internet Explorer\iexplore.exe
                 Opera (installed because I can't make it default browser if outside ProgramFiles) - C:\Program Files (x86)\Opera\opera.exe
- portable:   Chrome5 - D:\Joby\Internet stuff\ChromePortable\ChromePortable.exe
                  Iron4 - D:\Joby\Internet stuff\ChromePortable\App\IronPortable.exe
                  Firefox3 - D:\Joby\Internet stuff\FirefoxPortable3\FirefoxPortable.exe
                  Palemon - D:\Joby\Internet stuff\Palemoon-Portable\Palemoon-Portable.exe
                  SeaMonkey2 - D:\Joby\Internet stuff\SeaMonkeyPortable\SeaMonkeyPortable.exe
Title: Re: Make web search in current opened browser
Post by: lanux128 on May 21, 2010, 02:45 AM
Edit: Forgot to say that I started using this tool a while back, Browser Chooser (http://browserchooser.codeplex.com/), but it involves one more mouse click and quite some attention.

Browser Chooser was also discussed here (https://www.donationcoder.com/forum/index.php?action=search2;search=Browser+Chooser) as an alternative but somehow it didn't work


The main priority should be: is it opened (only 1)? use it!

If none opened: use A.
If 2 opened: if A and B or C or D - use A
                    if B and C or D - use B
                    if C and D - use C
If 3 opened: if A and any 2 other - use A
                    if B and C and D - use B
If all opened - use A.

the logic looks nice.. i'll work out something along these lines. :)

• BrowserA = Opera
• BrowserB = Chrome5
• BrowserC = Iron4
• BrowserD = Firefox3
Title: Re: Make web search in current opened browser
Post by: lanux128 on May 22, 2010, 05:43 AM
here is the version you requested, supports four browsers - A to D in order of preference. you may want to edit the INI file first to reflect the actual path in your system. also in certain cases, you may have to change the "BrowserX_ProcessName" section since this "ProcessName" is used to detect which browsers are open, e.g. Iron Portable's processes are seen in the system as "Iron.exe" not "IronPortable.exe" and so on.

please try this out and let me know how it works out for you. :)


Edit: i've uploaded the fixed version in this post here (#post_FBL4).
Title: Re: Make web search in current opened browser
Post by: joby_toss on May 22, 2010, 07:29 PM
You might wonder why I haven't replied yet!

It's because I'm speechless!

 :Thmbsup:
Title: Re: Make web search in current opened browser
Post by: lanux128 on May 22, 2010, 10:10 PM
You might wonder why I haven't replied yet!

It's because I'm speechless!

i'm glad that they work well for you and thanks for your kind words. 8)
Title: Re: Make web search in current opened browser
Post by: lanux128 on May 23, 2010, 02:48 AM
btw, FBL will work wherever you can specify a custom browser like this:
c:\pathto\Farr_Browser_Launcher2.exe <url>

currently i have it working in mIRC as well. to make it work, put the following lines in your remote section (press Alt+r to invoke the scripts editor dialog).

on ^*:hotlink:*//*.*:*: { }
on *:hotlink:*//*.*:*: { run C:\Program Files\DonationCoder\Farr\Scripts\Farr_Browser_Launcher2.exe $1 }
on ^*:hotlink:*www.*:*: { }
on *:hotlink:*www.*:*: { run C:\Program Files\DonationCoder\Farr\Scripts\Farr_Browser_Launcher2.exe $1 }

obviously you need to change the path accordingly. :)
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: joby_toss on May 23, 2010, 04:20 AM
Obviously, FBL was designed for and works within FARR as lanux128 described here (https://www.donationcoder.com/forum/index.php?topic=21680.msg206064#msg206064).

But the cool thing is that it works with other apps, too, like mIRC (see the above post).

It also works with Executor (http://executor.dk/); just go to Settings->Misc. and enter FBL's path in the "Optional browser" field (and don't forget the $U$ parameter for keywords).
(http://img192.imageshack.us/img192/5381/screenshot2305201012153.png)

Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: thancock20 on June 04, 2010, 11:24 AM
Thank you so much for this lanux128.  I just made it my default browser (using a little freeware tool called "DefaultBrowser"), and so far it's working just fine.  :Thmbsup:
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: lanux128 on June 04, 2010, 09:51 PM
you're welcome, thancock20. you can also edit the INI file to change the browsers or their preference order. :)
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: thancock20 on June 04, 2010, 11:26 PM
Oh, I guess I should have mentioned I had already edited the INI file.  If Firefox is open it's used, but if not then Chrome is.  I just decided today to try making it the default browser, and see if it would work across all of Windows instead of just programs that allow a custom browser.  So far, I haven't had any problems with it.  :)
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: lanux128 on June 04, 2010, 11:35 PM
thanks for the report, that's good to know. your reports confirms that Farr_Browser_Launcher (FBL) will act as a middleman for opening links without any problems. :Thmbsup:
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: thancock20 on June 22, 2010, 04:01 AM
UPDATE: I recently discovered that when I clicked on some html files (ones with spaces in them) I would get some really strange results.

However, I looked in the source and changed this line

  geturi := %0%

to

  geturi := """" . %0% . """"

and, after compiling, it now works like a charm.

Of course, this issue would never come up if the program was only used as originally intended.  But I thought I would share in case anyone else wanted to go the route of making FBL their default browser.

Also, this is the original 2 browser version, but I imagine the 4 browser version has a line like the one above as well.
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: lanux128 on June 22, 2010, 08:20 AM
in most cases the .htm and .html filetypes are already given arguments in enclosed quotes like this "%1" (see pic). e.g. "C:\Program Files\Mozilla Firefox\firefox.exe" -requestPending -osint -url "%1". if you don't mind, can you check in the Folders Option and see how it is configured at your system?

[ You are not allowed to view attachments ]
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: thancock20 on June 22, 2010, 11:44 AM
I don't mind at all.  I've got
 
"C:\Program Files\FindAndRunRobot\Farr_Browser_Launcher.exe" "%1"

So, yes, the quotes are there.

I'm using Directory Opus as my file manager and bblean as my shell, but I don't think that would make a difference. I am curious if anyone else has had the issue; but, as far as I know, nobody else has tried using FBL as their default browser. They haven't posted about it, anyway. It's certainly saved me a lot of time not having to wait for Firefox to load up (I have quite a few extensions) every time a program I'm using decides to open a web page.  I don't have any extensions in Chrome at all, so I can use it as my "I want to take a look at something quickly" browser.
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: lanux128 on June 22, 2010, 09:52 PM
that's strange, i can't re-enact this error on my PC.. furthermore you've got the quotes and all in your registry, i'm not sure why it doesn't work for you. however it's good that you found a solution for it. :)
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: joby_toss on June 23, 2010, 02:43 PM
Hmm...I'm having a similar issue as thancock20 and his fix seems to work for me too.
But sadly, I need the 4 browsers version of FBL.  :(
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: thancock20 on June 23, 2010, 07:57 PM
that's strange, i can't re-enact this error on my PC.. furthermore you've got the quotes and all in your registry, i'm not sure why it doesn't work for you. however it's good that you found a solution for it. :)

That is strange.  Strange enough that I switched my shell back to Explorer and turned off Directory Opus' integration with Windows, and tried the original version of the script again.  I still had the issue, so I was right in thinking they didn't cause it.

I even searched through the registry, just to make sure every instance of the command line had the quotes, and they do. 

I also double checked to make sure Firefox and Chrome still work correctly when they're the default browser.  Yes they do.

I tried removing the quotes in Edit File Type and got a "error parsing url parameters" in both versions.  I also removed the whole "%1" argument, and both versions tried to open 0.  I ran these tests because the original version when used to override the default browser in FARR - with no argument at all - will open the same html files launched through FARR just fine.  The problem comes when I try to open the files in Directory Opus (or Explorer).

I can't figure out why the script and the registry both need the quotes to work on my machine, but only the registry on yours.  Like you said, though, I'm glad I did get it to work on my machine.

Hmm...I'm having a similar issue as thancock20 and his fix seems to work for me too.
But sadly, I need the 4 browsers version of FBL.  :(

So I'm not the only one with the problem.  This just keeps getting stranger.

By the way, I downloaded the 4 browser version to take a look at it; but the ahk file isn't included in the zip and it needs a password to decompile the exe.  So, I guess I'll stop meddling with lanux128's code now.
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: lanux128 on June 23, 2010, 09:33 PM
@thancock20 and joby_toss:
can either of you post a screenshot of the error message (if there is one)? also can you edit the INI file and put the browser path in quotes like this: "C:\Program Files\Mozilla Firefox\firefox.exe" and let me know what happens?

in the meantime, i'll post a newer version with thancock20's fix into both versions but i'm just curious as to why it doesn't work. :)

Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: thancock20 on June 23, 2010, 10:57 PM
It's not really an error message.  If I try to open a file called C:\Testing FBL\Read Me.html, my browser pops up these three tabs:

1. file:///C:/Testing
2. fbl%2FRead
3. me.html

As you can see, it splits right where the spaces are.  That's what made me think about adding the quotes in.

Also, I put the quotes around the browser path in the INI file, but there was no change to the way either version works.

And just in case it makes any difference, I'm running Windows XP SP3.
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: joby_toss on June 23, 2010, 10:58 PM
Let me describe my problem:

1. FBL works correctly with FARR (no problems here)
2. when using Executor, I have a keyword "i" for IMDB search, and a keyword "ic" for doing an IMDB search for the current clipboard contents. If the clipboard contains "Pulp" for example, there are no problems. If however it contains "Pulp fiction", there will be 2 searches made in the current opened browser (no matter which one, no matter if it's enclosed in quotes in the .ini file): one IMDB search for "Pulp" and one Google search for "fiction" (separate tabs; I think the Google search is done because it is the default search engine...).
3. when making FBL the default handler for .html files for example, "D:\Downloaduri\help.html" is opened correctly, but "D:\Downloaduri\he lp.html" opens two erroneous tabs: "file://localhost/D:/Downloaduri/he" and "http://lp.html/".
4. no error windows, just erroneous behavior.
5. same thing when using PowerPro (to open a file or doing an web search through FBL).
6. thancock20's fix seems to work.
7. I'll make a video demo (when I come from work, around 13.00 GMT) if it helps.
8. have no idea what's happening :)

The curious thing is that I never noticed this before (I use FARR more and FBL is not the default browser).
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: lanux128 on June 24, 2010, 07:39 AM
@thancock20 and joby_toss:
thanks for the details both of you. i'll work on the fix.

Edit: i've uploaded a new version here (https://www.donationcoder.com/forum/index.php?topic=21680.msg206064#msg206064). please give this a try and let me know. btw, i haven't tested with FBL4 as the default browser so your feedback is important. :)
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: joby_toss on June 24, 2010, 10:23 AM
It works OK for me.
Thank you!
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: joby_toss on June 24, 2010, 12:32 PM
I don't know how many PowerPro fans/users are here, but I will try to mention one way you can use PP (with clip.dll plugin) and FBL together.

Take a look at the image below (you get to that by Ctrl+RightClick on a PP bar -> Configure -> Command list -> Add new before/after (while selecting the desired PP bar).

[ You are not allowed to view attachments ]

1- choose a name for your button
2- write the tooltip to be displayed on mouse hover over the utton
3- choose the path for a custom icon for your button
4- enter the path of your FBL executable
5- enter the Command parameters. Examples:

http://www.google.com/search?q= &(clip.get)
for Google search for current clipboard content

http://thepiratebay.org/search/ &(clip.get)/0/7/0
for TPB search for current clipboard content

http://www.imdb.com/find?s=all&q= &(clip.get)
for IMDB search for current clipboard content

http://www.youtube.com/results?search_query= &(clip.get)
for Youtube search for current clipboard content

http://www.thefreedictionary.com/_/dict.aspx?word=&(clip.get)
for TFD search for current clipboard content

If you don't add " &(clip.get)" expression, you'll get to the search page of that particular website (and you can do a regular web search).

Also, you can do the same with a hotkey instead of a button bar:

[ You are not allowed to view attachments ]

Forgot to say that if the "Command parameters" field contains only the expression "&(clip.get)" and the clipboard contains an url, then that url will be opened in the current browser.

Cheers!
Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: mark_ninan on September 21, 2010, 07:52 PM
Just curious, but wouldn't it be easier if the default method be for FARR to just launch the website in the browser that's opened at that point in time? If no browser's opened then let FARR open it in the default browser. That seems like the simplest solution. If we want to launch the website in a particular browser, then we can use the alias thingy mentioned by mouser. Is this by any chance possible?

Title: Re: Make web search in current opened browser - Farr_Browser_Launcher by lanux128
Post by: mark_ninan on September 21, 2010, 10:39 PM
This thought just occurred to me just after posting... if we like have 5 browsers open at the same time           (for example) FARR could just launch the desired website into the browser that's in use at that point in time. Like the top-most window/the window where the cursor is in.