Firefox batch download extension: DownloadSelected

In my previous post, I mentioned about DownThemAll on Firefox 56. Now the latest release of Firefox is version 61, but there is no update of DownThemAll for Firefox Quantum support. Using older unsupported version like Firefox 56 is not a good idea, because there will have no security update. Firefox ESR 52 is slower than Firefox 56 as I have mentioned.

Since I have spare time recently, I spent some days to write a Firefox extension, DownloadSelected, to solve my problem.

DownloadSelected demo

The screenshot above shows a list of URLs, which I used Greasemonkey script to generate. Then highlight, right-click, and DownloadSelected. I don’t write any UI elements to indicate the download progress, but I put the progress to the console. Once the files are downloaded, they will be archived into a zip file and a Save As dialog will be shown. The source code can be found here.

This is not a replacement or alternative extension to DownThemAll, but this extension solve my fundamental problem. Main features are:

  1. Bulk download
  2. Download only selected text
  3. Downloaded filenames are based on HTML text instead of URLs
  4. Quantum and Google Chrome compatible

 

Firefox Legacy version 56.0.2

The latest Firefox version 57 and above, a.k.a Firefox Quantum, it is fast, but… that is not what I need.

As a developer, I favoured Chromium more than Firefox. And I use Firefox mainly for downloading. The addon DownThemAll is the must. The greatest feature I love is the ability to highlight and download the selected hyperlinks as batch. And I can name the downloaded files by original filename or based on the text in HTML.

DownThemAll in Firefox 56
DownThemAll in Firefox 56

This is neither Google Chrome nor Firefox Quantum can do.

With Firefox Quantum, there is no more support for legacy addons. As a result, unless the addon developers update their project, nothing more we can do. We can either install other Firefox variants such as Firefox ESR, Waterfox, Palemoon, etc (as suggested by one of the DTA reviewers). In my opinion, with WebExtensions API, DTA developer may face some issues to develop for Quantum support.

I tried to install Firefox ESR (which is actually 52.5.0) in order to use DTA. However, it is extremely slower comparing to Firefox 56. When Firefox 54 was released, it was the best Firefox ever and it was really fast comparing to the older versions. Therefore, in order to use the latest Firefox that supports legacy addon, I choose to install Firefox 56 without removing the latest Firefox Quantum.

How to install older Firefox (for Linux only)?

  1. Use Google to search an older Firefox, you should get a URL like this: https://ftp.mozilla.org/pub/firefox/releases/56.0.2/
  2. Choose the link (directory) that matches your target machine, Windows 32-bit / 64-bit, Linux 32-bit / 64-bit, etc. Then choose a language that you prefer. For my case, I downloaded Firefox 56.0.2 for Linux 64-bit.
  3. Download and extract it to some location, such as /opt/firefox56.

Now, you should able to invoke Firefox 56 by (but don’t run it now)

/opt/firefox56/firefox

Run the above command will use the same profile as your default Firefox (if you installed Firefox Quantum).

Create another profile

Your Firefox profile should locate at ~/.mozilla/firefox/, named as xxxxx.profilename.

(NOTE: Suggest to make a backup of your default profile.)

Easiest way to create another profile for another version of Firefox,

  1. Create a new profile using command firefox -ProfileManager. Because this will update profile.ini as well.
  2. Exit Firefox Profile Manager.
  3. Locate to the directory of the profile, then delete all the files and directories within the profile, i.e, make it empty. (NOTE: Do not delete your default profile.)
  4. Copy all the files and directories of your default profile to the empty profile in step 3.
  5. Now you can run Firefox with the new profile, like /opt/firefox56/firefox -P profilename.

Create shortcut (application menu, aka desktop entries, for Linux only)

Because the Firefox we installed is just by extracting. There is no desktop entry file created. Therefore, we need to create our own desktop entry file. This can be done by creating a file as ~/.local/shared/applications/firefox-legacy.desktop.

The following is the content,

Name=Firefox Legacy
GenericName=Web Browser
Icon=firefox
Type=Application
Categories=Application;Network;
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
Encoding=UTF-8
Exec=/opt/firefox56/firefox -P legacy %u
Terminal=false
MultipleArgs=false
StartupNotify=false
StartupWMClass=Firefox

where the /opt/firefox56/firefox -P legacy %u, with the legacy as the profile name. You can modify this line to your target profile name.

Then, restart your gnome-panel or whatever panel, it should generate this menu item named as Firefox Legacy. Now, you can run two different versions of Firefox simultaneously.

(Side note: WordPress with Markdown mode enabled is the best!)

Firefox or Chromium (software development)?

I was switching from Chromium to Firefox as my primary web browser recently. Then, I switched back to Chromium again.

Chrome was usually claimed that it consumes a lot of memory. And recent Firefox updates claim that it is faster and consumes less memory. That is why, I switched to Firefox. I agree that, it is much faster than before. However…

I faced a critical issue. One less important issue that I would like to mention is, Firefox does not support Google Hangout.

The critical issue I faced related to JavaScript. During the web development or even visit CircleCI (which I believe it has heavy usage of JavaScript), if the JavaScript has severe errors, whatever web browser you are using will stop respond or slow down. But, Chrome (Chromium I mean) deals the issue differently from Firefox. The whole computer will be slow down temporary (may be several minutes), then at the end, the page will be shown as “dead” and I can control over my computer again.

In the same condition, Firefox will expand the memory (possibly exponentially) due to the errors. Then the computer starts slowing down and stop respond until I do a hard reboot. Based on my observation, the memory grows and uses all the RAM. When the RAM is not available, the memory is immediately stored into the Swap. Because storing into the Swap, that is the hard drive, it is much slower for me to switch to a Terminal to kill Firefox. And even I successfully switch to a Terminal, typing the command and see the response takes approximately infinite time, yet the Swap memory usage keeps growing non-stop.

As a web developer, I prefer to use Chrome.

Running multiple Firefox with different versions in Linux

Previously, in my post of the other blog, I mentioned that I have to use command-line to run multiple Firefox with different versions. Now, I found an easy solution to solve this problem. Please note that, running different version of Firefox should using different profile, just to avoid downgrading and upgrading the profile based on the Firefox version.

Assuming we installed Firefox Nightly version,

  1. Firstly, using the command-line to create a new profile using ProfileManager,
    firefox-nightly --no-remote -ProfileManager
  2. Then create a profile, such as “Nightly” as the profile name. After creating this profile, we can exit the Profile Manager.
  3. Make sure that we did not change our default profile, that means running “firefox” or “firefox-nightly” will use “xxxxxxxx.default” profile. This also means that whenever we run Firefox, the “xxxxxxxx.default” profile will be used.
  4. To run the Firefox Nightly version without entering the command-line “firefox-nightly –no-remote -P Nightly”, we can create the “desktop” file to the ~/.local. We can do this by copying the installed “desktop” file, such as
    cp /usr/share/applications/firefox-nightly.desktop ~/.local/share/applications/

    This will copy the firefox-nightly.desktop to the ~/.local/share/applications/ and override the default “desktop” file.

  5. Edit the ~/.local/share/applications/firefox-nightly.desktop, at the Exec key, change it to
    Exec=firefox-nightly --no-remote -P Nightly %u

    This will result that when we launch the Firefox Nightly from the Applications Menu, the “Nightly” profile will be used instead.
    As a result, we need not to use the command-line to run the instance with different profile.

Now, you can enjoy Firefox with Nightly, Aurora, Beta, or any other Firefox versions in one OS.

Firefox 15 with built-in PDF plugin

Firefox, though I like it, I still feel a lot of limitations of using it, especially reading the PDF using the plugin from Adobe Reader. This is really a drawback. Because the plugin in Linux I feel that it is not very stable. That is why, normally I open the online PDF with Chromium, because Chromium (Google Chrome) has built-in PDF plugin.

Now, Firefox 15 has a built-in PDF plugin as well. By default, it is disabled. So, we need to enable it manually.

At the address bar, enter “about:config”. Then you are able to edit some configurations of the Firefox. So, search “pdfjs.disabled”, change the value to “false”. Yes, now, it is enabled. I forgot whether restart is required or not. Just try any PDF, then you will see the difference.

However, if comparing the viewing quality with Chromium, the text in Firefox is quite rasterised (pixelated). Yet, I am still enjoy with this new feature.

Firefox or Chromium (Google Chrome)

Yes, again web browser. I am using Firefox. Only sometimes Chromium (Google Chrome). Mainly Firefox. If someone ask me, which one I choose, I definitely answer Firefox. But, if someone ask me, which one I prefer, then it will be difficult to answer.

Firstly, I would like to go through why I choose Firefox as my primary web browser.

Because of DownThemAll. There is no alternative extension in Google Chrome like DownThemAll. Why I like DownThemAll so much? I use DownThemAll with GreaseMonkey to download my favourite mangas (comics). This is something Google Chrome still cannot do it, based on my current knowledge. GreaseMonkey generates the links, right-click, then I DownThemAll.

Another two addons, DownloadHelper and FlashGot. Both of them allows me to download any online video or audio streaming. Google Chrome doesn’t have this type of extension.

Actually, all of these limitations of Google Chrome are because of extension API restriction. That is why, there is no similar replacement for DownThemAll, DownloadHelper and FlashGot. However, I wonder why there is no one uses NPAPI to build the similar extension in Google Chrome.

Next advantage of Firefox is the bookmarks. The best feature I like is the tagging feature. This help me to search my unorganised bookmarks easier. I know, Google Chrome uses a different approach to solve this problem. Google Chrome is more to cloud computing and searching algorithm, it solves the problem by using Google Bookmark search. This is something I don’t like, without internet connection, Google Chrome can done less thing than Firefox. (You might said, without internet connection, your web-browser can do nothing, yet I can said, I can still do the web development without proper internet connection, or manage my bookmarks when I don’t have internet connection.)

Then, if I definitely choose Firefox over Google Chrome, why do I need to post this blog? Sure, there is some beauty about Google Chrome which always makes me to consider to switch to it. Firstly, its interface is really clean and simple. The interface make me feel more to the webpage instead of web-browser. Firefox makes me feel that I am using Firefox; Google Chrome makes me feel that I am visiting the websites.

Secondly, for the developers, creating extension using Google Chrome is super easy comparing creating a Firefox addon. Firefox addon needs to follow a lot of convention and using XUL, which is not easy to learn (for me). It needs to create “chrome.manifest”, “install.rdf”, and so on. The documentation is also not very good (I personally feel).

Thirdly, Google Chrome has Chrome Web Store, this is something which Firefox lacks of. But even if there exists Mozilla Web Store, I will not prefer it, unless the Mozilla Web Store is a superset of Chrome Web Store, then I may like it.

Then, there are several other reasons, such as Google Chrome open and close is faster than Firefox. Though Firefox startup is far more better than its older version, it is still slower than Google Chrome. And if closing the Firefox, then you want to start the Firefox again, you need to wait a while. Besides that, enable or disable the addons needs to restart Firefox also. May be this is the price paid for the good addons like DownThemAll, FlashGot and DownloadHelper.

Add another Google Search plugin to Linux Mint Firefox

When I run Firefox of Linux Mint, using the default Google Search from the search bar, it shows an old fashion search result. We can add search engine plugin manually. When we visit Facebook, Youtube, etc, there is a highlight on the search bar icon, click it we can add our own search engine. However, when we visit Google Search, it does not highlight the icon. Then, how?

  1. Visit searchplugins.net.
  2. Enter ” http://www.google.com/#q=TEST ” (without quotes) for Search URL
  3. Enter “My Google” (without quotes), or whatever name you want, but not the name already existed in Firefox search engines
  4. Click “Create Plugin”
  5. Then, you will see that your search bar icon is highlighted.
  6. Add the search engine plugin to your Firefox.

With that, we can use the new fashioned Google Search engine in Linux Mint.

Chromium is really good in netbook

Compare to the Firefox, I prefer to run Chromium in my netbook. This is because the screen of the netbook is small, and the resolution is low. Using Firefox, the toolbars and file menu already occupies half of the screen. I think Firefox 4.0 will solve my problem.

Then, using Firefox on the netbook with Ubuntu, playing Castle Age will make Firefox slow down. May be the reason is the netbook memory is smaller than normal laptop.

However, I am still using Firefox on Ubuntu. Because of the powerful extensions on Firefox, such as DownThemAll, FlashGot, etc.