Sign in to follow this  
Followers 0
remin

Open url's in Active browser

7 posts in this topic

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

if winactive

shellexecute("path broswer","URL")

that's  the way.

 

Saludos

Edited by Danyfirex

 

venezuela.png Would you like to say thank to Danyfirex using a warmy way?  offer me a cup of coffee... coffee.png

autoit_scripter_blue_userbar.png

       AutoIt...

 

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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.

Edited by Iczer
1 person likes this

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0