Jump to content

Open url's in Active browser


remin
 Share

Recommended Posts

I have 3 browsers installed on my pc:

1) chrome (=default)

2) firefox

3) ie

When I click on an URL in an external program, it always launches the default browser (chrome in my case) regardless of whether or not the active browser is the default browser or not. I don't want this.

When my active browser is firefox i want to open the external url's in firefox, when the active browser is IE I want to open the external url's in IE.

When Chrome is the active browser or when no browser is currently open, the url's must be redirected to chrome.

Is it possible to realize this with the help of autoit?

Link to comment
Share on other sites

if winactive

shellexecute("path broswer","URL")

that's  the way.

 

Saludos

Edited by Danyfirex
Link to comment
Share on other sites

I don't think that alone will solve your problem.

First you need to detect the you have clicked a link in some other application.

Given the amount of applications there are out there, that's no trivial task.

Probably need to do some sort of shell hooking, where you can detect a browser window opening, and then go from there.

Maybe research the possibility of discovering where the message to open that browser window actually originated.

Best of luck.

Keep us informed.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

It maybe simplier than it seems - you can compile small autoit exe and make it "default browser". So windows do all work, and you choice browser to start as Danyfirex suggested.

 

Can you please tell a bit more about your solution.

I don't understand what you mean, sorry.

Link to comment
Share on other sites

he means, that in the registry you can set your default browser.

If you set it to your own script, you can simply use Danyfirex' suggestion in post #2 in it.

I have not tried it, but I assume the link would be passed to your script as a command line parameter.

It would be fairly straight forward, here are some pointers to get you started.

Learn how to get command line arguments.

Well that's about it really besides ShellExecute and a bit of logic.

Have a go and report back if you have trouble.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...