Archive

Archive for the ‘firefox’ Category

A “read it later” add-on for Firefox

September 29, 2016 Leave a comment

Problem
At my workplace I found two interesting links that I decided to read at home. I didn’t want to save their URLs and e-mail them to me, so I made a search if there is a good “read it later” add-on for Firefox. And then I got surprised.

Solution
It turned out that Firefox has such an add-on by default! That is, such an add-on is included in Firefox and it is called Pocket. Read more about it here.

So I put its icon next to my search bar and started to use it. It’s awesome! It also has a mobile app. so I can read the saved articles anywhere.

Hmm, I’m sure there are lots of other gems in the softwares that we use on a daily basis and we have no idea about them…

Categories: firefox

view the generated HTML source in Firefox

July 20, 2016 Leave a comment

To view the generated HTML source in Firefox, use this bookmarklet:

javascript: var win = window.open(); win.document.write('<html><head><title>Generated HTML of  ' + location.href + '</title></head><pre>' + document.documentElement.innerHTML.replace(/&/g, '&amp;').replace(/</g, '&lt;') + '</pre></html>'); win.document.close(); void 0;

This tip is from here.

limit the CPU usage of Firefox / Dropbox / etc.

June 24, 2016 Leave a comment

Problem
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?

Solution
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.

Categories: bash, firefox Tags: ,

Firefox: disable detach tab

Problem
Clicking on a tab and then moving your mouse in a downward motion causes a new window to open.

Solution
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.

Categories: firefox Tags: , ,

open a web page from a bash script

February 4, 2016 Leave a comment

Problem
How to open a web page from a bash script?

Solution
Under Manjaro:

$ 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.

Categories: bash, firefox Tags:

AutoFocus

November 28, 2015 Leave a comment

Problem
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?

Solution
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.

Speed up Firefox page load by 44%

Details here.

In short:

  1. about:config
  2. privacy.trackingprotection.enabled -> true