![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||||||||||||||||||||||||||||||||||||
|
Ubuntu addict and loving it
![]() Join Date: Aug 2008
Location: Caprica City
Beans: 4,179
Ubuntu 9.10 Karmic Koala
|
Firefox optimization and troubleshooting thread
The objective of this thread is to provide a simple, but comprehensive, list of optimizations for Firefox and help with troubleshooting common issues (this is a work in progress).
Index
Benchmarks Performance First of all, I would recommend to bookmark the Peacekeeper benchmark page and perform some benchmarks to establish a base performance index on your machine. This benchmark could present variable results depending on what you are running simultaneously with Firefox, how many and which extensions you have. So I recommend doing all tests just after booting and using a clean Firefox profile, so you can establish a base for comparison. For example, here are my benchmarks, showing the difference between browsers and the improvement I have achieved since I installed Jaunty. Quote:
Bandwidth Another benchmark tool that can be useful is Speedtest.net, which allows to determine if you have speed issues on your connection. Page Loading Extended Statusbar - is a Firefox extension that adds a statusbar with speed, percentage, time and loaded size (similar to Opera's one) Profiles Firefox uses profiles to store configuration data. Each profile has it's own folder and it contains all your bookmarks, extensions, passwords, cookies and other stuff. Profiles are stored in your home directory, under the hidden folder .mozilla/firefox/. To see it, you need to hit CTRL+H when browsing home. The default profile folder name has a series of random letters and number, followed by .default (example: ydtehagr8ja.default). You can create any number of profiles you want. They won't affect each other. To create a new profile, close Firefox the open "Applications >> Accessories >> Terminal", then paste (CTRL+SHIFT+V) the code below in the terminal window and hit enter: Code:
firefox -P For a full list of command, visit https://developer.mozilla.org/en/Command_Line_Options Backups Firefox profiles can become corrupted and cause several problems. So, backing up your profile is the best way to avoid them. You can do that by simply copying the contents of ~/.mozilla/firefox/ or using FEBE extension, which allows to schedule backups of your entire profile or some parts of it, then easily restore them. You can learn how to use FEBE here. You can also easily backup/restore bookmarks using Firefox Bookmark Manager. Open "Bookmarks >> Organize Bookmarks" then select one of the options of the "Import and Backup" drop-down menu. Firefox also makes regular backups of your bookmarks, than can be restored through the same menu. Another option would be using an online synchronizing tool like Xmarks or Mozilla Labs - Weave Sync. See other options here. Database Optimization Firefox stores a lot of data, for example bookmarks, into standalone sqlite [wikipedia.org] database files. They can be found in your profile directory and have the extension .sqlite (for example places.sqlite). While sqlite databases are very practical, because don't need a server to run, sometimes they can become very slow. I don't know exactly how it happens, but some data is not completely removed when you delete entries and this can increase the size of the database considerably, slowing down the database performance. You can avoid this problem by optimizing Firefox databases to remove the junk data: 1 ) install sqlite3 2) Create a new empty file in your script directory (usually ~/bin) and rename it to firefox-optimize, then add the code below to it and save it. Code:
#!/bin/bash
killall firefox
find $HOME/.mozilla/ \( -name "*.sqlite" \) -exec sqlite3 {} "vacuum" \;
Code:
firefox-optimize Quote:
Code:
sqlite3 $HOME/.mozilla/firefox/yourprofile/places.sqlite "vacuum" Extensions Optimization The availability of extensions is one of the main reasons I use Firefox. They provide lots of interesting and useful features, but they can also slow down Firefox considerably. As you can see from my benchmarks, when I run Firefox with several extensions, the performance drops about 20-40%. I'm currently using 43 of them. You can see my extension collection here. Some extensions might slow down Firefox more then others. Finding which extensions are slowing you down more is not so simple, but the simplest way to do it is too disable all of them, then enable one by one and test Firefox, until you can pinpoint the culprit. To disable extensions open "Tools >> Addons", then select the "Extensions" tab, then select the extension you want to disable and click the "Disable" button. You need to restart Firefox to make this effective, since all extensions files are loaded when you start Firefox. Also check the Problematic Extensions in the Mozilla Knowledge Base site. If you don't want to get rid of slow extensions, then you could disable extensions that you don't use very often and enable them only when you need. The extension QuickRestart will make the process of enabling/disabling extensions easier. You can also avoid the need to restart Firefox by using the Extension Developer extension. It has a toolbar button that allows you to reload Firefox extensions without closing it. Nevertheless, you might experience some weird behaviors while using it. Another approach could be creating specific purposes profiles. For example you have an extension that you use only eventually on a couple of sites, you could create a profile with the extensions you need for regular use and another profile with the extensions you don't use regularly. You can launch multiple profiles when you need them using the -no-remote option (see Profiles section). Speed Optimization Extensions FasterFox - Performance and network tweaks for Firefox. Fasterfox allows you to tweak many network and rendering settings such as simultaneous connections, pipelining, cache, DNS cache, and initial paint delay. Fasterfox Lite - This is based on FasterFox, but without prefetching. Prefetching was removed for this Lite version because it wasted a lot of server bandwidth as well as causing unnecessary server load. AdBlock Plus: prevents unnecessary and annoying content from loading. This might speed up some pages and it will certainly make your web experience more enjoyable. Quote:
Firefox Preferences Tweaks Firefox stores it's preferences in a file called prefs.js in your profile folder, but you don't need to edit this file manually. Most common settings can be changed through Firefox menu, by opening "Edit >> Preferences". Additional settings can be changed by typing about:config in the address bar. This will open the preferences file directly in the Firefox window. The first time you open the about:config page it will warn you about voiding warranty (???) and possible damages that you could cause. If you mess with the settings so badly that you can run Firefox properly, then simply restore a backup of your profile (see Backup section) or delete the prefs.js file and restart Firefox. To modify a Preference values in the about:config page you can:
To create a new Preference, right-click anywhere and select the "New" option, then "String", "Integer" or "Boolean". The first if for complex values, the second is for numbers and the third is for true or false. Some preferences tweaks can improve performance of loading pages and content. There are several tutorials out there about this. The following one is very popular and covers most of the commonly suggested changes (some also changed by FasterFox extension). http://www.ubuntugeek.com/speed-up-f...b-browser.html Keep in mind that some of these tutorials are outdated and the settings they suggest might not have any effect on the Firefox version you are using. To check if a particular setting is still valid, what it does and the recommended settings, you can browse the Mozilla Knowledge Base. Here are some of the most popular settings that you can change:
ipv6 Network became slow due to the unsupported ipv6 protocol, so disabling ipv6 could help. To disable ipv6 on Firefox Preferences, set the network.dns.disableIPv6 to true. 1. Type about:config in the address bar, press Enter. 2. Find network.dns.disableIPv6 in the list. 3. Right-click -> Toggle. 4. Restart your Mozilla application and try again. You can also disable ipv6 on the system. How To Disable IPV6 in Ubuntu 9.04 ? Flash Optimization Flash has been a problem for a long time and is works really bad on Jaunty. When I play an embedded video, the CPU usage increases a lot. The amount of stress on the CPU depends on several factors, but when measuring the CPU usage while playing the same video file with gnome-mplayer and embedded in the site, the difference is huge. For example, this video, which uses h264 codec from YouTube, raises the CPU usage to about 45% of it's capacity. The same video only uses 9% of my CPU if downloaded and played with gnome-mplayer. It's probably not a Firefox issue, since most browsers I tested displayed the same problems, including Chromium. But there is definitely something wrong (see and vote for bug fix). Unfortunately, there is no magical fix, but you can try a few things below. Quote:
Removing Conflicting Plugins Ubuntu comes with swfdec plug-in, but it doesn't work on several sites. Installing the version from Adobe might solve this problem and improve performance. To remove other flash plug-ins and install only the one from Adobe open "Applications >> Accessories >> Terminal", then paste (CTRL+SHIFT+V) the code below in the terminal window and hit enter: Code:
sudo apt-get remove swfdec-mozilla sudo apt-get remove mozilla-plugin-gnash sudo apt-get remove adobe-flashplugin sudo apt-get remove flashplugin-nonfree sudo apt-get install flashplugin-nonfree Flash Tweaks Some people reported improvements doing this (original source): Code:
sudo mkdir /etc/adobe echo "OverrideGPUValidation=true" >~/mms.cfg sudo mv ~/mms.cfg /etc/adobe/ Quote:
Compiz, Xorg and Graphics Tweaks Some modifications to the xorg.conf file might improve overall performance, including Firefox and Flash. Some of this might not apply to your graphics card. Intel graphic cards users check the Jaunty Intel Graphics Performance Guide. First make sure you have the proprietary graphics card driver installed. Go to "System >> Administration >> Hardware Drivers" and enable the corresponding driver. To edit the xorg file run this: Code:
gksudo gedit /etc/X11/xorg.conf Code:
Section "DRI" Mode 0666 EndSection Section "Extensions" Option "Composite" "Enable" EndSection Compiz users might get considerable flash performance improvement in full screen mode by disabling the option Unredirect Fullscreen Windows that can be found under "System >> Preferences >> CompizConfig Settings Manager >> General Options >> General". Blocking Flash Content Using NoScript or FlashBlock extensions can also help. They are not solutions, but prevent flash content from loading on pages that you don't need, specially if they are banners and other useless stuff. Flash Replacements Considering the current status of flash in Jaunty I'm moving towards a replacement solution instead of a fixing solution, particularly in regard to streaming videos. There are a few alternatives for playing this type of flash content. Unfortunately, most solutions compromise usability or do not work on every web site. The easiest solution is to download the content, using the built in tools of Firefox or a download extension, then playing with your favorite media player. I recommend Video Download Helper. But unless I want to keep the video for later viewing, I find this annoying. For better integration with video players, there is the Media Player Connectivity extension, which allows you to load the video with your favorite media player by simply clicking on it. The main problem of this extension is that you have to click on every flash content you want to see embedded, which is very annoying on sites with flash interfaces. You can also use a modified version of Netvideohunter extension to automatically detect videos on a page and play them with mplayer. See discussion here. The nicest solution I have found so far is a Greasemonkey script, that replaces the embedded plash player with mplayer. This one has a nice set of tools and replace the YouTube video player seamlessly, using my gecko-mediaplayer plugin (image below), but it just works on YouTube. There are other similar scripts for other web sites that you can download here. Running Profiles from RAM As already explained in the Database Optimization section, Firefox stores lots of information on sqlite databases, compromising performance when disk access is high. This section provides a script, that allows to load the entire Firefox profile into RAM, thus avoiding excessive disk access during sqlite operations and thus increasing performance considerably. Quote:
Quote:
Code:
sudo apt-get install sqlite3 zenity rsync Code:
gedit ramprofile.sh Code:
#!/bin/bash
TODAY=$( date +%Y%m%d )
NOW=$( date +%H:%M )
#test if fstab already have a firefox entry
if test -z "$(cat /etc/fstab | grep -F "firefox" )"
then
#kill firefox to prevent errors
killall firefox
zenity --info --text "Make sure Firefox is closed before proceeding" &&
#create a profile backup in your home folder
tar cvf ${HOME}/firefoxprofiles-${TODAY}-${NOW}.tar ${HOME}/.mozilla/firefox /etc/fstab &
#grab profile list and create a new script to allow profile selection (I know could be more elegant)
echo "#!/bin/bash" > ${HOME}/.mozilla/firefox/profileselect.sh
echo "" >> ${HOME}/.mozilla/firefox/profileselect.sh
echo 'PROFILE=$(zenity --list --height=300 --width=300 --text "Firefox Profiles" --radiolist --column "Select" --column "Profile" \' >> ${HOME}/.mozilla/firefox/profileselect.sh
cat $HOME/.mozilla/firefox/profiles.ini | sed "/Path/!d" | sed "s/Path=//g" | sed "s/.*/1 \'&/g" | sed "s/.*/&\' \\\/g" >> ${HOME}/.mozilla/firefox/profileselect.sh
echo ")" >> ${HOME}/.mozilla/firefox/profileselect.sh
echo 'echo ${PROFILE} > ${HOME}/.mozilla/firefox/profile.txt' >> ${HOME}/.mozilla/firefox/profileselect.sh
chmod +x ${HOME}/.mozilla/firefox/profileselect.sh
#run the script to select the profile
${HOME}/.mozilla/firefox/profileselect.sh
#Input variables
PROFILE=$(cat $HOME/.mozilla/firefox/profile.txt)
RAM=$(zenity --list --height=400 --width=150 --text "How much Mb of RAM to allocate? Your cache size is 20Mb" --radiolist --column "Select" --column "Memory to be allocated for profile" \
1 '64M' \
2 '96M' \
3 '128M' \
4 '160M' \
5 '192M' \
6 '224M' \
7 '256M' \
8 '288M' \
9 '320M' )
SYNC=$(zenity --list --height=400 --width=150 --text "Profile synchronization frequency in minutes?" --radiolist --column "Select" --column "Frequency" \
1 '05' \
2 '10' \
3 '15' \
4 '20' \
5 '25' \
6 '30' \
7 '35' \
8 '40' \
9 '45' \
0 '50' \
1 '55' )
#backup and modify fstab based on selected variables
sudo cp /etc/fstab /etc/fstab.bak
cat /etc/fstab.bak | sed -e '/firefox.*/d' > ${HOME}/.mozilla/firefox/fstab
echo "firefox ${HOME}/.mozilla/firefox/${PROFILE} tmpfs size=${RAM},noauto,user,exec,uid=1000,gid=1000 0 0" >> ${HOME}/.mozilla/firefox/fstab
sudo mv ${HOME}/.mozilla/firefox/fstab /etc/fstab
#move the original profile to ramprofile
mv ${HOME}/.mozilla/firefox/${PROFILE} ${HOME}/.mozilla/firefox/ramprofile
#modify firefox preferences
cat ${HOME}/.mozilla/firefox/ramprofile/prefs.js | sed -e "/user_pref(\"browser.cache.disk.enable.*/d" | sed -e "s/user_pref(\"browser.cache.disk.capacity.*/user_pref(\"browser.cache.disk.capacity\", 20000);/g" | sed -e "/user_pref(\"browser.safebrowsing.enabled.*/d" | sed -e "/user_pref(\"browser.safebrowsing.malware.enabled.*/d" > ${HOME}/.mozilla/firefox/prefs.js
echo "user_pref(\"browser.safebrowsing.enabled\", false);" >> ${HOME}/.mozilla/firefox/prefs.js
echo "user_pref(\"browser.safebrowsing.malware.enabled\", false);" >> ${HOME}/.mozilla/firefox/prefs.js
echo "user_pref(\"browser.cache.disk.enable\", true);" >> ${HOME}/.mozilla/firefox/prefs.js
cat ${HOME}/.mozilla/firefox/prefs.js > ${HOME}/.mozilla/firefox/ramprofile/prefs.js
rm -f ${HOME}/.mozilla/firefox/prefs.js
#create empty profile folder
mkdir ${HOME}/.mozilla/firefox/${PROFILE}
#send the profile to RAM
mount "${HOME}/.mozilla/firefox/${PROFILE}"
#copy original profile contents to RAM profile
rsync -av -p -o -g ${HOME}/.mozilla/firefox/ramprofile/ ${HOME}/.mozilla/firefox/${PROFILE}/
#create cron job
echo "" > ${HOME}/.mozilla/firefox/.change.cron
echo "USER=$USER" >> ${HOME}/.mozilla/firefox/.change.cron
echo "HOME=$HOME" >> ${HOME}/.mozilla/firefox/.change.cron
echo "SHELL=/bin/bash" >> ${HOME}/.mozilla/firefox/.change.cron
echo "PATH=/sbin:/bin:/usr/sbin:/usr/bin" >> ${HOME}/.mozilla/firefox/.change.cron
echo "DISPLAY=:0.0" >> ${HOME}/.mozilla/firefox/.change.cron
echo "MAILTO=$USER" >> ${HOME}/.mozilla/firefox/.change.cron
echo "" >> ${HOME}/.mozilla/firefox/.change.cron
echo "0-59/${SYNC} * * * * rsync -av -p -o -g --delete ${HOME}/.mozilla/firefox/${PROFILE}/ ${HOME}/.mozilla/firefox/ramprofile/" >> ${HOME}/.mozilla/firefox/.change.cron
crontab ${HOME}/.mozilla/firefox/.change.cron
#launch firefox
LAUNCH=$( echo "${PROFILE}" | sed 's/.*\.//g' )
zenity --info --text "Firefox profile ${LAUNCH} is loaded into RAM. Firefox launch automatically now. Don't forget to unload the profile after using Firefox!" &&
firefox -P ${LAUNCH} &
else
#alert in case fstab already have a firefox entry
zenity --info --text "The fstab already has a Firefox entry. You should try to unload the profile from RAM first."
fi
exit
Then run this command to make it executable: Code:
chmod +x $HOME/ramprofile.sh Quote:
Code:
ramprofile.sh
Quote:
The next script is used to unload the profile after using Firefox, after a system crash or after rebooting without unloading the profile first. Run this command to create a new file called ramprofile.sh, in your home directory: Code:
gedit restoreprofile.sh Code:
#!/bin/bash
#close firefox
killall firefox
zenity --info --text "Make sure Firefox is closed before proceeding" &&
#Input variables
PROFILE=$(cat $HOME/.mozilla/firefox/profile.txt)
if test -z "$(mount | grep -F "${HOME}/.mozilla/firefox/${PROFILE}" )"
then
zenity --info --text "The profile is not mounted. The script will check if the fstab has Firefox entries..." &&
if test -z "$(cat /etc/fstab | grep -F "firefox" )"
then
zenity --info --text "The fastab has no Firefox entries. It seems all necessary steps have been taken to uload the profile from RAM, but you should check your profile folders to see if everthing is in place."
else
zenity --info --text "The script will try to restore the fstab, remove temporary files, clear cron jobs and restore your profile, but you should check your profile folders to see if everthing is in place."
#remove cron jobs
echo "" > ${HOME}/.mozilla/firefox/.change.cron
crontab ${HOME}/.mozilla/firefox/.change.cron
#delete temporary files, restore the profile to disk and restore fstab
rm -fr ${HOME}/.mozilla/firefox/${PROFILE}
rm -f ${HOME}/.mozilla/firefox/.change.cron
rm -f ${HOME}/.mozilla/firefox/profile.txt
rm -f ${HOME}/.mozilla/firefox/profileselect.sh
mv ${HOME}/.mozilla/firefox/ramprofile ${HOME}/.mozilla/firefox/${PROFILE}
sudo mv /etc/fstab.bak /etc/fstab
zenity --info --text "Profile successfuly unmounted. You might need to restore a profile from a backup."
fi
else
if test -z "$(cat /etc/fstab | grep -F "firefox" )"
then
zenity --info --text "The fastab has no Firefox entries, but the profile is mounted. The script will try to fix this..."
#backup and modify fstab based on selected variables
sudo cp /etc/fstab /etc/fstab.bak
cat /etc/fstab > ${HOME}/.mozilla/firefox/fstab
echo "firefox ${HOME}/.mozilla/firefox/${PROFILE} tmpfs size=200M,noauto,user,exec,uid=1000,gid=1000 0 0" >> ${HOME}/.mozilla/firefox/fstab
sudo mv ${HOME}/.mozilla/firefox/fstab /etc/fstab
#remove the profile from RAM
umount "${HOME}/.mozilla/firefox/${PROFILE}"
#remove cron jobs
echo "" > ${HOME}/.mozilla/firefox/.change.cron
crontab ${HOME}/.mozilla/firefox/.change.cron
#delete temporary files, restore the profile to disk and restore fstab
rm -fr ${HOME}/.mozilla/firefox/${PROFILE}
rm -f ${HOME}/.mozilla/firefox/.change.cron
rm -f ${HOME}/.mozilla/firefox/profile.txt
rm -f ${HOME}/.mozilla/firefox/profileselect.sh
mv ${HOME}/.mozilla/firefox/ramprofile ${HOME}/.mozilla/firefox/${PROFILE}
sudo mv /etc/fstab.bak /etc/fstab
zenity --info --text "Profile successfuly unmounted. You might need to restore a profile from a backup."
else
#remove cron jobs
echo "" > ${HOME}/.mozilla/firefox/.change.cron
crontab ${HOME}/.mozilla/firefox/.change.cron
#sync the profile from RAM to disk
rsync -av -p -o -g --delete ${HOME}/.mozilla/firefox/${PROFILE}/ ${HOME}/.mozilla/firefox/ramprofile/
#remove the profile from RAM
umount "${HOME}/.mozilla/firefox/${PROFILE}"
#delete temporary files, restore the profile to disk and restore fstab
rm -fr ${HOME}/.mozilla/firefox/${PROFILE}
rm -f ${HOME}/.mozilla/firefox/.change.cron
rm -f ${HOME}/.mozilla/firefox/profile.txt
rm -f ${HOME}/.mozilla/firefox/profileselect.sh
mv ${HOME}/.mozilla/firefox/ramprofile ${HOME}/.mozilla/firefox/${PROFILE}
sudo mv /etc/fstab.bak /etc/fstab
#optimize profile databases
find ${HOME}/.mozilla/firefox/${PROFILE} \( -name "*.sqlite" \) -exec sqlite3 {} "vacuum" \;
zenity --info --text "Profile ${PROFILE} was successfully unloaded."
fi
fi
exit
Then run this command to make it executable: Code:
chmod +x $HOME/restoreprofile.sh Code:
restoreprofile.sh
The next script is used to synchronize the profile while using Firefox. The first script already provides a cron job to do that, but in some circumstances you might want to synchronize it manually. Run this command to create a new file called syncprofile.sh, in your home directory: Code:
gedit syncprofile.sh Code:
#!/bin/bash
#Input variables
PROFILE=$(cat $HOME/.mozilla/firefox/profile.txt)
if test -z "$(mount | grep -F "${HOME}/.mozilla/firefox/${PROFILE}" )"
then
zenity --info --text "The profile is not mounted."
else
#sync the profile from RAM to disk
rsync -av -p -o -g --delete ${HOME}/.mozilla/firefox/${PROFILE}/ ${HOME}/.mozilla/firefox/ramprofile/
zenity --info --text "Profile ${PROFILE} in RAM was successfully synchronized with disk copy."
fi
exit
To use it, open a Terminal and run this command: Code:
restoreprofile.sh Installing Other Versions If you don't like to wait until new Firefox releases hit the official repositories, you can install fresh final releases from Mozilla, development versions or alternative browsers build upon Firefox code. You can find easy installation methods below. Quote:
Installation Methods 1 - Manual installation of fresh final releases from Mozilla Quote:
Code:
cp -R ~/.mozilla ~/.mozilla.backup sudo tar -jxvf firefox-*.tar.bz2 -C /opt rm firefox-*.tar.bz2 sudo mv /opt/firefox/plugins /opt/firefox/plugins.backup sudo ln -s /usr/lib/xulrunner-addons/plugins /opt/firefox/plugins sudo ln -s /opt/firefox/firefox /usr/local/bin/firefox To revert these changes and use Firefox 3.0.x again, run the following command: Code:
sudo rm /usr/local/bin/firefox && sudo rm -r /opt/firefox 2 - Automatic installation of fresh final releases from Mozilla You can install fresh final releases and keep updating them using the Ubuntuzilla. It's easy to install this way and also to remove it. 3 - Installation of development versions You can install development versions of Firefox using the semi-official ubuntu-mozilla-security or ubuntu-mozilla-daily PPA repositories. Follow the instructions on the link below: https://help.ubuntu.com/community/FirefoxNewVersion Quote:
Quote:
4 - Installing Alternative Browsers 4.1 - SHIRETOKO Shiretoko 3.5 final release is available in the Universe repositories so you can install it clicking here or through the Add/Remove manager or using the command below: Code:
sudo apt-get install firefox-3.5 4.2 - SWIFTFOX Swiftfox is an optimized build of Mozilla Firefox. Swiftfox has builds for both AMD and Intel processors and is based on the most cutting edge Firefox source code available. It is installed side-by-side with Firefox, but shares the user profiles. To install follow the instructions at http://getswiftfox.com/deb.htm 4.3 - SWIFTWEASEL Swiftweasel is a build of Mozilla Firefox source code, which uses non-trademarked graphics and logos. It is optimized for several architectures, and is available for the Linux platform only (original article). The main difference when compared to Swiftfox is that Swiftweasel is free and open source software, while Swiftfox's binaries are proprietary. To install, first download the tar.gz file for your architecture at http://sourceforge.net/projects/swiftweasel/files/, saving it in your home directory. Then run the following commands in the terminal: Code:
sudo tar -xvf swiftweasel-3.5*ubuntu.tar.gz -C /opt rm swiftweasel-3.5*ubuntu.tar.gz sudo ln -s /usr/lib/xulrunner-addons/plugins /opt/swiftweasel/plugins sudo ln -s /opt/swiftweasel/swiftweasel /usr/local/bin/firefox Code:
sudo rm /usr/local/bin/firefox && sudo rm -r /opt/swiftweasel Quote:
Method Comparison All methods install another version of Firefox on a separate location and can be used side-by-side with the official Ubuntu Firefox of your distribution. #1 - this method is easy to perform, gives you total control of which version you will install and it gives you only official Mozilla releases, with Firefox branding (name and logo). Additionally, it uses the same Firefox profiles as the official Ubuntu version and updates your Firefox launchers automatically. It does not provide new version checking and download. You have to download new versions manually, remove the old version before updating with a new one and perform the installation commands for each new install. #2 - essentially the same as the method #1, but provides a way to check for updates from Mozilla releases site and install them automatically. Also provides an automated method of removal. Initial setup is not as easy as the manual installation, but is not complicated at all, since the automated script is provided as a deb install. It requires a single command to perform installation/removal of Firefox and other Mozilla applications. #3 - more complicated to setup, since you need to configure additional PPA repositories. Depending on the PPA selected, you will get Firefox updates that are currently undergoing security testing or updates that are currently under development. This is not recommended if you want only stable releases, since you will probably get pre-alpha, alpha and beta releases as well. Additionally, all versions will not be Firefox branded. They use the development codenames, like Shiretoko or Minefield, and a default blue logo. These versions are not only installed side-by-side with Firefox 3.5, but also have their own Firefox profile folders, which might be complicated to maintain if you go back to stable official releases or when you upgrade Ubuntu. Versions installed by this method also have their own menu launchers, available through the "Applications >> Internet" menu. #4.1 - this method allows you to install unlicensed development versions of Firefox like the method #3 (actually this method is included in the method #3 procedures), but updates are performed only after being proposed by the universe repository maintainers and approved to enter this repository. You won't get regular updates like using the PPA repositories, but it's easier to configure and more stable. For instance, when Jaunty was released, the version installed by this method was Shiretoko 3.5 beta4pre, then it as updated to rc2 a couple of weeks before the official release of Firefox 3.5 and was updated to the final release less then a week after Mozilla. This method also creates new launchers. Your current Firefox profiles are automatically copied and put on a separate folder under ~/.mozilla #4.2 - this method allows you to install cutting-edge versions of Firefox, optimized for your processor and branded as Swiftfox. It can be installed by using deb files or the Swiftfox repositories. Depending on which deb file you get or which updates you accept from the repositories, you might also get development versions. For instance, by the time of writing, Swiftfox version being provided was 3.5rc3-1. The major advantage of this method is the availability of versions optimized for your processor, which might result in a considerable performance boost. In the other hand, the major disadvantage is that these versions are non-free and the source code is not available. Unlike Shiretoko, Swiftfox versions uses the same profiles as your official Ubuntu Firefox installation, but also creates it's own launchers. #4.3 - this method is essentially the same as 4.2, but Swiftweasel is free and open source software. It is distinct from Swiftfox in that Swiftweasel is completely free while Swiftfox's binaries are proprietary. Extension Compatibility When you install a new version directly from Mozilla or through the other methods above, some of your extensions won't work, because they are dependent on the Firefox version. But the extension compatibility check can be disabled by setting the preference extensions.checkCompatibility to false. Some extensions might work this way, because they don't have anything in their code that could break on the new Firefox version, they just haven't been tested yet and the authors didn't change the version compatibility in the installation file. So when you disable extension check, they work as usual. Nevertheless, some extensions might have incompatible code, so use it at you own risk. You can also use the Nightly Tester Tools extension to override compatibility of other extensions. Completely disabling the compatibility check Other Optimizations General System Optimization This is not related directly to Firefox, but it is part of my optimizations that improved all browsers performance, including flash performance, so I decided to include the link here. http://ubuntuforums.org/showthread.php?t=1152095 Troubleshooting Several Firefox problems are related to corrupted profiles and can be easily fixed by restoring a profile backup (see Backup section), by deleting the corrupted profile or deleting specific files inside the profile. Usually, there is no need to re-install Firefox. Quote:
You can find some common symptoms and possible solutions below. Keep in mind that your Firefox might display one or more of these symptoms and they are not mutually exclusive. Quote:
Quote:
Symptoms:
Quote:
Solution [FOT001]: Check the permissions of ~/.mozilla/ and ~/.mozilla/firefox/ folders. If these folders are owned by root, then it could prevent Firefox from saving settings or even running. To change the permission back to you, close Firefox and run this command: Code:
sudo chown -R $USER:$USER ~/.mozilla Symptoms:
Solution [FOT002]: Simply hitting the F11 key twice should bring Firefox to normal maximized state. To fix this problem permanently, close Firefox, delete the file localstore.rdf in your profile and start Firefox again. Quote:
Symptoms:
Solution [FOT003]: Close Firefox and delete the file places.sqlite from the profile folder. Quote:
Symptoms:
Solution [FOT004]: Some video issues are caused by conflicting plug-ins. It's not a good idea to have multiple plug-ins for the same type of content. To remove conflicting flash plug-ins and install only the one from Adobe open "Applications >> Accessories >> Terminal", then paste (CTRL+SHIFT+V) the code below in the terminal window and hit enter: Code:
sudo apt-get remove swfdec-mozilla sudo apt-get remove mozilla-plugin-gnash sudo apt-get remove adobe-flashplugin sudo apt-get remove flashplugin-nonfree sudo apt-get install flashplugin-nonfree Quote:
Symptoms:
Solution [FOT005]: Make sure your connection settings are correct (e.g., Tools -> Options -> Advanced -> Network / Connection -> Settings). If the settings reset after restart, then delete the file user.js from the profile folder, to reset proxy settings. Additionally, disable ipv6 on Firefox Preferences, by setting the network.dns.disableIPv6 preference to true. 1. Type about:config in the address bar, press Enter. 2. Find network.dns.disableIPv6 in the list. 3. Right-click -> Toggle. 4. Restart your Mozilla application and try again. Quote:
Symptoms:
Solution [FOT006]: Open "Edit >> Preferences >> Content" and click the "Advanced" button in the "Fonts & Colors" section, then edit the font size and color. Untick the option "Allow pages to use their own fonts, instead of my selections above". Symptoms:
Solution [FOT007]: This is due to color management feature, which allows to correct image colors based on embedded color profiles. You could disable color management, but the best way is to enable color management for tagged graphics only, which means all images will display correctly, even if they don't have color profiles. 1. Type about:config in the address bar, press Enter. 2. Find gfx.color_management.mode in the list. 3. Right-click -> Modify. 4. Set the value to 2. 5. Restart Firefox If you still experience issues, then disable color management entirely, by setting the value above to 0. If you also have gfx.color_management.enabled properties, try to reset it or change it to true. This preference should not be present on Firefox 3.5. Quote:
Symptoms:
Solution [FOT008]: Quote:
Code:
export LD_PRELOAD=/usr/lib/libGL.so.1 Code:
moz_libdir=/* Code:
LIBDIR=/*
Symptoms:
Solution [FOT009]: First make sure you don't have conflicting plugins by removing them. To remove conflicting flash plug-ins and install only the one from Adobe open "Applications >> Accessories >> Terminal", then paste (CTRL+SHIFT+V) the code below in the terminal window and hit enter: Code:
sudo apt-get remove swfdec-mozilla sudo apt-get remove mozilla-plugin-gnash sudo apt-get remove adobe-flashplugin sudo apt-get remove flashplugin-nonfree sudo apt-get install flashplugin-nonfree Then go to "System >> Preferences >> Sound" and set "Music and Movies" to Alsa and check if it works. If changing sound settings doesn't work, then you can try to fix pulseaudio or remove it completely. To fix pulseaudio visit HOWTO: PulseAudio Fixes & System-Wide Equalizer Support. To remove pulseaudio and install esound follow this. Removing pulseaudio and installing esound should probably fix this and also gives better system performance. Quote:
Symptoms:
Solution [FOT010]: Disable the safe browsing feature. To do that, go to "Edit >> Preferences >> Security", uncheck "Block reported attack sites" and "Block reported web forgeries". Quote:
Quote:
Symptoms:
Solution [FOT011]: Firefox 3.5 on Jaunty (a.k.a. Shiretoko) uses the directory ~/.mozilla/firefox-3.5 to store profile contents, while the default Firefox version on every Ubuntu release uses ~/.mozilla/firefox. When you installed Shiretoko you didn't see any difference because Shiretoko was setup to make a clone of your Firefox 3.0 profiles. But in Karmic, there is no more Shiretoko and the default browser is already Firefox 3.5. So, close Firefox and replace the contents of ~/.mozilla/firefox with the contents of ~/.mozilla/firefox-3.5. Compiling Firefox What does compiling means? Quote:
Yes. First, you don't have to wait for the update of the repositories when a new version is released. You can just download Firefox source code from Mozilla site and compile it yourself. But the most important reason, in my opinion, is that you can optimize Firefox to run on your machine, using especial settings that makes it "talk" better with your specific CPU. My current Firefox performance was improved by 30% after compiling it for my processor specs. Is it complicated to compile Firefox? Compiling Firefox is not as complicated as it sounds. Nevertheless, it requires some reading and configuration if you want to get the most of the optimization features (I should give the proper credit to TheLions for helping with my first Firefox compilation). Quote:
Procedures Quote:
Code:
sudo apt-get install build-essential checkinstall sudo apt-get build-dep firefox sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev Code:
tar -xjf firefox-*-source.tar.bz2 Open ~/mozilla-x.y.z and create an empty file and name it .mozconfig. This is the file where you will put the compilation options. This is my .mozconfig file, optimized for Pentium4 3.06Ghz HT Prescott: Code:
. $topsrcdir/browser/config/mozconfig
export MOZILLA_OFFICIAL=1
export BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
ac_add_options --enable-official-branding
export CHOST="i686-pc-linux-gnu"
export CFLAGS="-O3 -march=prescott -pipe -fomit-frame-pointer"
export CXXFLAGS="-O3 -march=prescott -pipe -fomit-frame-pointer"
export CPPFLAGS="-O3 -march=prescott -pipe -fomit-frame-pointer"
ac_add_options --enable-application=browser
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --enable-optimize
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-xft
ac_add_options --enable-extensions=default
ac_add_options --enable-strip
ac_add_options --enable-install-strip
ac_add_options --enable-pango
ac_add_options --enable-svg
ac_add_options --enable-canvas
ac_add_options --disable-tests
ac_add_options --disable-accessibility
ac_add_options --disable-mochitest
ac_add_options --disable-debug
ac_add_options --disable-installer
ac_add_options --disable-crashreporter
ac_add_options --disable-parental-controls
ac_add_options --with-pthreads
Quote:
Quote:
Quote:
After configuring the .mozconfig for your processor and preferences, save it and run the following commands: Code:
cd ~/mozilla-x.y.z make -f client.mk build To install it, you need to cd into the obj directory, which is something like this: Code:
cd ~/mozilla-x.y.z/obj-i686-pc-linux-gnu Then simply run the following commands: Code:
make sudo checkinstall Code:
firefox-3.0 Removal If you didn't change the package parameters during the checkinstall configuration, then you will be able to remove the newly installed Firefox from the Synaptic Package Manager, by marking the package mozilla-x.y.z for removal. If you changed the parameters, then search for the corresponding package in Synaptic. Manual Installation & Removal Instead of using sudo checkinstall, you can simply use sudo make install for installing your compiled version of Firefox, but you won't be able to remove it using Synaptic. To remove it manually, run the following commands: Code:
sudo rm -f /usr/local/bin/firefox sudo rm -fr /usr/local/lib/firefox-y.z.x sudo rm -fr /usr/local/lib/firefox-devel-y.z.x sudo rm -fr /usr/local/share/idl/firefox-y.z.x sudo rm -fr /usr/local/include/firefox-y.z.x Quote:
Compiling with Profile-Guided Optimization What is Profile-Guided Optimization (PGO)? Quote:
To compile Firefox with PGO you have to add a couple of lines to the .mozconfig file and use a different command when building the code. Add the following lines in red to .mozconfig: Code:
. $topsrcdir/browser/config/mozconfig
export MOZILLA_OFFICIAL=1
export BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
ac_add_options --enable-official-branding
export CHOST="i686-pc-linux-gnu"
export CFLAGS="-O3 -march=prescott -pipe -fomit-frame-pointer"
export CXXFLAGS="-O3 -march=prescott -pipe -fomit-frame-pointer"
export CPPFLAGS="-O3 -march=prescott -pipe -fomit-frame-pointer"
ac_add_options --enable-application=browser
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --enable-optimize
ac_add_options --enable-profile-guided-optimization
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-xft
ac_add_options --enable-extensions=default
ac_add_options --enable-strip
ac_add_options --enable-install-strip
ac_add_options --enable-pango
ac_add_options --enable-svg
ac_add_options --enable-canvas
ac_add_options --disable-tests
ac_add_options --disable-accessibility
ac_add_options --disable-mochitest
ac_add_options --disable-debug
ac_add_options --disable-installer
ac_add_options --disable-crashreporter
ac_add_options --disable-parental-controls
ac_add_options --with-pthreads
Save the .mozconfig file and run the following commands: Code:
cd ~/mozilla-x.y.z make -f client.mk profiledbuild To install it, follow the same installation procedure of the regular compilation process, using make and the checkinstall commands. For more information: https://developer.mozilla.org/en/Bui...d_Optimization That's it. Enjoy your super fast Firefox.
__________________
Quote:
Last edited by lovinglinux; 5 Days Ago at 06:29 PM.. Reason: Added Solution [FOT011] |
||||||||||||||||||||||||||||||||||||
|
|
|
|
|
#2 |
|
Quad Shot of Ubuntu
![]() Join Date: May 2007
Beans: 427
|
Re: Firefox optimization and troubleshooting thread
Great thread!
|
|
|
|
|
|
#3 |
|
Gee! These Aren't Roasted!
![]() Join Date: Dec 2008
Beans: 192
Ubuntu 9.04 Jaunty Jackalope
|
Re: Firefox optimization and troubleshooting thread
I've been having an issue with firefox reverting to backed up bookmarks on close, I wasn't able to find a profiles folder (I assume all this is in .mozilla right?), but I did find many files labled as such: places.sqlite-#.corrupt, and there were 83 of them numbered 1-83 in the folder .mozilla/firefox/kmhbvuwv.default . I also saw a filed called profiles.ini sitting in .mozilla/firefox but other than that no profiles folder.
I deleted all the .corrupt places.sqlite files that I found, but all that happened was the icons next to all my bookmarks were lost, and still reverted back to the backup |
|
|
|
|
|
#4 | |
|
Ubuntu addict and loving it
![]() Join Date: Aug 2008
Location: Caprica City
Beans: 4,179
Ubuntu 9.10 Karmic Koala
|
Re: Firefox optimization and troubleshooting thread
Quote:
Delete all places.sqlite-#.corrupt just in case, but the one that is important is the places.sqlite without #.corrupt in the name. Just delete it and start Firefox again. It should fix the problem. The file profiles.ini has nothing to do with your problem. It is the file that lists all profiles you have, but I think you have just one. Anyway, don't delete it. |
|
|
|
|
|
|
#5 |
|
Gee! These Aren't Roasted!
![]() Join Date: Dec 2008
Beans: 192
Ubuntu 9.04 Jaunty Jackalope
|
Re: Firefox optimization and troubleshooting thread
Ah, I see. Anyway, I deleted places.sqlite about 3 times now, created a new bookmark, then closed and reopened and my bookmark has yet to make it through the restart. I've noticed that my history disappears every time I delete it, but my bookmarks still revert. Would deleting the cached .json file that I restored from do anything?
|
|
|
|
|
|
#6 |
|
Gee! These Aren't Roasted!
![]() Join Date: Dec 2008
Beans: 192
Ubuntu 9.04 Jaunty Jackalope
|
Re: Firefox optimization and troubleshooting thread
I think I solved it, I mv'ed my .mozilla folder to .mozillabak and then restored my bookmarks from the recent backup and then added a few new ones. Everything has persisted, even through a full system startup.
Weird...but solved. What does places.sqlite do? |
|
|
|
|
|
#7 | |
|
Ubuntu addict and loving it
![]() Join Date: Aug 2008
Location: Caprica City
Beans: 4,179
Ubuntu 9.10 Karmic Koala
|
Re: Firefox optimization and troubleshooting thread
Quote:
The places.sqlite file is a database where bookmarks and browsing history are stored. |
|
|
|
|
|
|
#8 |
|
First Cup of Ubuntu
![]() Join Date: Aug 2008
Beans: 11
|
Re: Firefox optimization and troubleshooting thread
For the "Font too small.." problem (issue on big Plasmas and projectors typically), I recommend the "NoSquint" addon, with it set to apply a 20% increase on all pages (NoSquint's default mode is to remember specific pages).
http://urandom.ca/nosquint/ This is better than changing the font size as it scales the whole page (images too), making it less likely to have overlapping or truncated text. Now, if anyone could advise how to get Backspace working as a "Back" button like on other platform FF builds, I would be happy. |
|
|
|
|
|
#9 |
|
I Want My $2!!
![]() Join Date: Mar 2007
Location: Denver, CO
Beans: 7,058
Ubuntu 8.10 Intrepid Ibex
|
Re: Firefox optimization and troubleshooting thread
I haven't tried really anything in this thread yet, however just wanted to thank your for the time that went into preparing the advice in the guide. Very informative and a job well done!
|
|
|
|
|
|
#10 |
|
First Cup of Ubuntu
![]() Join Date: Jun 2007
Beans: 2
|
Re: Firefox optimization and troubleshooting thread
The "general system optimization" tips section in there is completely superfluous. It also happens to be full of misinformation, I'd just remove it or splice it out to another thread if I were you.
|
|
|
|
| Bookmarks |
| Tags |
| firefox optimization |
| Thread Tools | |
| Display Modes | |
|
|