How can I change the default web page at the system level?

I am trying to change the default web page, so that people using guest-session will open a specific web page instead of the default site.

Also, please note that when I installed Chromium, the Ubuntu default page comes up there too. There must be a global variable somewhere. Does anyone know where this variable is?


Solution 1:

Firefox

Not sure how to do this with chromium

Set default home page

You can set the default page by editing /etc/firefox/syspref.js

# Graphical
gksu gedit /etc/firefox/syspref.js

# Command line
sudo -e /etc/firefox/syspref.js

At the bottom of the file add:

user_pref("browser.startup.homepage", "http://google.com");

Obviously change "http://google.com" to the page of your choice (or not).

This change will not affect existing firefox profiles for existing users. You can reset all users home pages with

sudo sed -i -e '/startup.homepage/d' /home/*/.mozilla/firefox/*/prefs.js

change "/home/*" to "~user_name" for a single user.

sudo sed -i -e '/startup.homepage/d' ~bodhi/.mozilla/firefox/*/prefs.js

Lock home page

You can lock the home page for all users by editing /etc/firefox/syspref.js and using

lockPref("browser.startup.homepage", "http://google.com");

Although again this does not affect existing profiles, you would need to run the sed command again ;)

Solution 2:

I think the default is set in the package itself and can't be easily changed. However, when you create a new user, the files in /etc/skel get copied to the new user's home directory. You could create a new user, set it up as you want the default, and copy all that user's dotfiles into /etc/skel.

You mentioned using a guest session, though. I'm not sure if my method will work in guest sessions. Try it and see.

If it doesn't, here's another option: Create a guest user. Then put something like the following in ~/.logout:

shopt -s dotglob
rm -rf ~/* 
cp -a /etc/skel/* $HOME

This should cause the user to be reset every logout.

Solution 3:

Are you asking how to change the homepage of each of your browsers? The page that appears when you click on the browser to bring it up? If so, you can do that from within the browser. In Firefox go to Edit, click on preferences, and you will see a drop down. Make sure it say's go to my homepage...Browse to the page you wish to use and click on "Use current page"...That will then be your homepage and it will be the first page the browser will open too..Each user can set their own homepage from their own desktop. Same thing with Chrome, just click on the "Preferences" there too.