How to change home page with script? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 17

How to change home page with script?

i want to have link which change ( default home page google) to my website .

26th Mar 2018, 4:53 PM
Michal Ganaj
Michal Ganaj - avatar
3 Answers
+ 14
My friend mentioned this feature. Today, I was looking for this thing. Windows knew this over the command line. The example is for Firefox. <Code> @Echo off taskkill / im firefox.exe * / f cd / D "% APPDATA% \ Mozilla \ Firefox \ Profiles" cd * .default set ffile =% cd% echo user_pref ("browser.startup.homepage", "https://www.google.com"); >> "% ffile% \ prefs.js" set ffile = cd% windir% </ Code> Thanks for the explanation Jakob Marley
26th Mar 2018, 5:37 PM
Michal Ganaj
Michal Ganaj - avatar
+ 4
Thankfully, that was a really horrible idea that we got rid of. To the best of my knowledge, that's no longer possible. You could always force your users to use IE 6.0 or earlier, and then it would be possible. That doesn't make sense to do on any level though, as your users won't revert to an old browser just for your website AND they won't appreciate you trying to force them to change their homepage. If they want your page as their homepage, then they'll change their homepage to your website. In the world of the web, users hate being forced to do things they don't want to do.
26th Mar 2018, 5:04 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 1
@Michal You're more than welcome, Michal. In your example, you're directly manipulating the configuration file that the browser is using to store what the user set as their homepage. However, that requires local access to the computer itself and then the user must run the batch file themselves, so it won't work that way when dealing with your website's visitors. The only way that'll work for them is if you have them download your program that changes the homepage. Most often, today most people will create an area on their website that explains how to set your homepage, which is basically asking people to do it in a subtle manner.
26th Mar 2018, 7:15 PM
Fata1 Err0r
Fata1 Err0r - avatar