xralf xralf - 1 year ago 145
Javascript Question

Change homepage in Firefox programatically

Which Firefox API calls would you use to change homepage in Firefox programatically?

The purpose is to create a Firefox extension that is able to cycle through a few favourite pages (this is analogical to cycling through a few wallpapers on the desktop).

Answer Source

You can change the Firefox homepage by setting the preference "browser.startup.homepage".

The easiest way to do this in an add-on via JavaScript is:

Services.prefs.setCharPref("browser.startup.homepage", "http://mike.kaply.com");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download