Sunday, March 27, 2016

Firefox for Android on slow phones. Some practical advice.

This one was supposed to be a quick post; I might update it later on. And then I got carried away, and spent about four to six hours writing the post's content and refining its wording.

* That Firefox for Android can render better than the aged native browser on Android 2.3, is great, but at the moment, I won't go into detail about that.
* This post is not about desktop Firefox. I might write about issues current in desktop Firefox in a future post.

Contents

* What happened
* My phone is slow now.
* What to do. Extensions to speed up Firefox

Until today, I have avoided that "What I Use" post, but every once in a while comes a time, when I am not afraid to write about what I use. Even if it's not the newest kit.

Why I downgraded

After Firefox 45.0 was released, one early and now resolved issue was connection misbehavior with Firefox 45.0 and NoScript 3.5a10. Very soon, NoScript 3.5a11 was released, which fixed the issue.

Then, after upgrading, I also discovered, that Firefox 45.0 turned to using the Firefox-native toolkit for its main menu, which is slower than the natively formatted main menu in Firefox 44.0.2 and earlier.

For this and then-the earlier issue, I decided to downgrade back to Firefox 44.0.2 from version 45.0. The slow and inefficient main menu became cause not to upgrade any further on my device—except for testing.
Note, that when upgrading or downgrading apps in Android, use the overwrite method when installing; Do not uninstall the existing app version to then install a different version, or this action will forever delete all your user data for the app.

Backround

Thus, it slowly dawned on me, that my phone is showing its age. It's a Samsung Galaxy Mini 2, which model was released four years ago,[as of March 2016] but I got it in late 2013 as a pass-me-down, after it had two nearly grave misadventures with its previous owner.

* The Galaxy Mini 2 has an 800 MHz Snapdragon S1 CPU (specifically, MSM7227A), which is on the lower end of processors built on the ARMv7-A architecture, and uses the ARM Cortex A5 processor core.
* The phone runs Android 2.3.6 "Gingerbread", and won't be upgraded to a newer offical Android version.
* The device has just enough minimum required RAM memory to run Firefox for Android.

This soup of specifications essentially shows what the minimum for running a very modern version of Firefox for Android can be.

That major apps — such as Facebook and games — are not present, is a given. I've also excised other apps that I did not deem necessary anymore: BBC, ERR, Postimees, and a local service provider's player app.

What to do

In Firefox settings, disable telemetry and plugins. The Privacy Settings extension will make it simple to turn off other stuff.

Extensions to speed up Firefox

The following details two extensions that I use in Firefox for Android to have a reasonably passable browsing experience.

NoScript Anywhere.
In my phone, NoScript Anywhere ("NSA") makes browsing with Firefox a usable experience:
NoScript blocks scripts and plugins from running, and users can use the NoScript menu item to create an internal domain-based whitelist of sites which won't work without scripts. With this, NoScript not only blocks scripts, but also advertisements generated by scripts.
Another thing that shows the phone's age, is that the local daily "Postimees" launched a redesign of their mobile experience this month, and now their site redirects to their brand-new mobile site, which, if JavaScript-enabled, updates every ten minutes with AJAX, and that slows down the experience and the phone, and presumably eats away at the battery, too.

The obvious solution was to forbid postimees.ee from running scripts, thus removing it from the allowed sites list. This mangled the design somewhat, but at least the site will display reasonably responsively. Yes, it's a simplistic workaround, but it makes it possible to read news there, even if the site is not functional. The functional part was the possibility to rate comments, but "Postimees" removed the ostensibly anonymous commenting functinality. Most people just don't care to create a burner account on social media, and neither do they care risking their primary social media/e-mail accounts.

Privacy Settings
Another Firefox extension that reduces resource usage, is Privacy Settings. It's available at the Mozilla Add-ons site. With Privacy Settings, it's possible to switch off components that I don't have any need for. There are some settings that I have kept on, as switching all things to 'secure' may break rendering or accessing places like Instagram. While Privacy Settings won't work on older Firefox versions that can still run on Android 2.2 or earlier, or on ARMv6 CPUs, the extension's website has a breakdown of some of the about:config settings that one can modify manually.

I'm also considering the Policy Control extension, as it would reduce resource usage even further, and introduce more fine-grained control over which website can use which resources.

No comments: