program that can 'set default browser' ?

Discuss anything related to portable freeware here.
Post Reply
Message
Author
vmars316
Posts: 261
Joined: Thu Feb 09, 2012 11:47 am
Location: Colorado
Contact:

program that can 'set default browser' ?

#1 Post by vmars316 »

Hello & Thanks ;
Is there such a program that can 'set default browser' ?
Or maybe a cmd-line program or script ?
Thanks

freakazoid
Posts: 1212
Joined: Wed Jul 18, 2007 5:45 pm

Re: program that can 'set default browser' ?

#2 Post by freakazoid »

You should just rely on the native OS functionality for this. Unless your goal is to backup the existing default browser value so you can reinstate it after you've finished using your portable browser?

Another alternative is to use a file manager (such as XYPlorer Pro) that can open custom file extensions like .html. Tutorial for XYPlorer Pro can be found here: viewtopic.php?p=76915#p76915
is it stealth? ;)

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: program that can 'set default browser' ?

#3 Post by vevy »

vmars316 wrote: Fri Aug 07, 2020 2:27 pm Hello & Thanks ;
Is there such a program that can 'set default browser' ?
Or maybe a cmd-line program or script ?
Thanks
Perhaps you should clarify what you are trying to do? As it is, there are many ways to understand your question.

vmars316
Posts: 261
Joined: Thu Feb 09, 2012 11:47 am
Location: Colorado
Contact:

Re: program that can 'set default browser' ?

#4 Post by vmars316 »

Thanks ;
I am writing a freeware 'KidSafe Browser' .
When the user clicks on a link that wants to open up a new window (target = blank)
then the browser will call the 'default browser' to handle the new webpage request .
So I want to change the default browser when 'KidSafe Browser' starts up .
And change back when browser closes .
Any ideas ?

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: program that can 'set default browser' ?

#5 Post by vevy »

vmars316 wrote: Sun Aug 09, 2020 4:23 pm Thanks ;
I am writing a freeware 'KidSafe Browser' .
When the user clicks on a link that wants to open up a new window (target = blank)
then the browser will call the 'default browser' to handle the new webpage request .
So I want to change the default browser when 'KidSafe Browser' starts up .
And change back when browser closes .
Any ideas ?
😕 This is still confusing to me.
Is the user clicking the link form inside KidSafe Browser?
Why don't you change the behavior to open in a new tab inside KidSafe Browser. Is it that it doesn't use tabs?
Can't you intercept the link into a new KidSafe Browser window, or throw the URL into a new KidSafe Browser process.
"when 'KidSafe Browser' starts up". Do you mean with Windows, or when the user first uses it?
"And change back when browser closes ." A piece of advice, don't delay a global change till the normal exit of your program, because if and when it crashes, that change won't happen.


Anyway, I had mixed success with setting the default through the registry (using admin privileges of course). I say "mixed" because after it works for a few days, Windows occasionally decides to show an "open with" window as if to make sure the user really wants to continue using that default!

I think the keys for that are:
(For the current user)
HKEY_CURRENT_USER\Software\Classes\http\shell\open\command
HKEY_CURRENT_USER\Software\Classes\https\shell\open\command


(For all users)
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\command
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\command


Also, there is this program:
https://alternativeto.net/software/browser-chooser-2/

vmars316
Posts: 261
Joined: Thu Feb 09, 2012 11:47 am
Location: Colorado
Contact:

Re: program that can 'set default browser' ?

#6 Post by vmars316 »

Thanks vevy:
I am writing it first in SmallBasic , see how far I get .
Anyways , I ran across this :
https://danysys.com/set-file-type-assoc ... al-method/
Don't know hat SFTA is yet .
What do you think , something we cold do in PB ?
Thanks

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: program that can 'set default browser' ?

#7 Post by vevy »

vmars316 wrote: Wed Aug 12, 2020 1:11 pm Thanks vevy:
I am writing it first in SmallBasic , see how far I get .
Anyways , I ran across this :
https://danysys.com/set-file-type-assoc ... al-method/
Don't know hat SFTA is yet .
What do you think , something we cold do in PB ?
Thanks
I am not a programmer, so I don't know.
I haven't tried to circumvent the default app hash checking since the regular method works well enough for me.

One last thing is that you can set your own protocol in the registry. For example instead of http:, you can create vmars: and send and receive the URLs in your program this way. A side benefit is that you won't have to keep changing the default app for it.

Best of luck.

Post Reply