I have an older dual core laptop where Firefox sometimes uses 120%-130% CPU and slows down the machine completely. Restarting Firefox solves the problem for a few minutes but then again, it eats up the CPU. What to do?
I don’t have many tabs open but I still have this problem. I also uninstalled the Flash plugin but it didn’t solve the problem.
However, I found a nice tool called cpulimit:
“Cpulimit is a tool which limits the CPU usage of a process (expressed in percentage, not in CPU time). It is useful to control batch jobs, when you don’t want them to eat too many CPU cycles. The goal is prevent a process from running for more than a specified time ratio. It does not change the nice value or other scheduling priority settings, but the real CPU usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly. The control of the used CPU amount is done sending SIGSTOP and SIGCONT POSIX signals to processes. All the children processes and threads of the specified process will share the same percentage of CPU.” (from the README of the project)
The following setting worked for me:
$ cpulimit -l 80 firefox
Firefox uses several threads but as mentioned in the documentation, they will will share the same percentage of CPU.
The CPU usage may jump higher than the specified value, but
cpulimit will push it back in a few seconds.
My old laptop has become useable again :)
Update (with Dropbox)
I noticed that Dropbox also loves my CPU. Here is how I could limit this greedy beast. Originally, I started “$HOME/.dropbox-dist/dropboxd” automatically at each startup. Create the file “$HOME/bin/cpulimit_dropboxd.sh” with the following content:
#!/usr/bin/env bash cpulimit -l 50 $HOME/.dropbox-dist/dropboxd
Make it runnable (
chmod u+x cpulimit_dropboxd.sh) and call this script (
cpulimit_dropboxd.sh) when your system comes up. Here I give 50% CPU for Dropbox but you can play with that value.
Clicking on a tab and then moving your mouse in a downward motion causes a new window to open.
Install this patch: https://addons.mozilla.org/en-US/firefox/addon/bug489729-disable-detach-and-t/ and in its GUI select “Disable detach tab”.
Frankly, this FF “feature” was driving me crazy.
How to open a web page from a bash script?
$ xdg-open http://your/url
However, it opened Chrome by default while I’m a Firefox believer. Here is the remedy:
$ xdg-settings set default-web-browser firefox.desktop $ xdg-open http://your/url
Now it works as it is supposed to work.
You visit some websites quite often but the focus is not put on the input field, so you need to click there each time. Google puts the focus on the input field when you want to do a query. Why can’t other sites do the same?
I got fed up so I wrote a Greasemonkey script that does the autofocus job for me. Thus, after opening such a site, I can type immediately.
You can find the script here: https://github.com/jabbalaci/AutoFocus . The script is very simple and can be customized easily. Currently it contains 2 rules: one for Wikipedia, and one for IMDb.
I use several machines and I would like to create a unified list that contains my favourite Firefox add-ons. This list could be kept in Dropbox, thus I could access it on all my machines. How to generate a list of installed add-ons?
The add-on Addon List Dumper can do exactly this. Here is a screenshot about this add-on:
There are certain sites where links are randomly redirected to other sites and if you want to visit the intended link, you need to click on the link three or four times and then maybe you are sent to the correct URL.
I found a Firefox add-on called Redirect Bypasser that allows you to visit the correct URL. On a link it shows a little icon, and the little icon is linked to the good URL.