Jump to content

Firefox

From postmarketOS Wiki
Alt text
Firefox running on Phosh with mobile-config-firefox

postmarketOS ships the desktop version of Firefox as default in Phosh and Plasma Mobile, the mobile and privacy friendly configuration from mobile-config-firefox. To remove this configuration, uninstall the mobile-config-firefox package.

Installation

Depending on the user interface you have installed, Firefox-esr is already part of your postmarketOS installation (e.g. in Phosh and Sxmo). For others, install the following two packages:

doas apk add mobile-config-firefox firefox-esr

Instead of firefox-esr, you can also install firefox to get the slightly newer version (but be aware that sometimes it includes changes that break the mobile configuration, and we need a bit to catch up with it. Help with that is of course always appreciated).

Alternatives

The upstream Firefox packages does not disable most telemetry and similar tracking shipped by upstream. Consider using librewolf, a privacy-centric fork which disables Mozilla's first-party spyware and analytics:

apk add librewolf

Additional install mobile-config-firefox-librewolf to get the mobile tweaks..

Tweaks

Mobile Settings

To access mobile settings installed with mobile-config-firefox visit:

about:mobile

Disable Sponsored Sites

We don't want this since the wrong amazon is burning!

about:config

browser.newtabpage.activity-stream.showSponsored

set all to false.

Video Pop Out

You can actually disable the annoying video pop-out in about:config set:

media.videocontrols.picture-in-picture.enabled

to false.

Ai features

Disable Ai features, go to about:config and set

browser.ml.chat.enabled

to false.

Disable Tab Preview

go to

about:config

and set both

browser.tabs.hoverPreview

to false.

Hide https in url bar

go to about:config

and set

browser.urlbar.trimHttps

to true.

Disable warning when closing tabs

micro ~/.mozilla/firefox/*.default-release/user.js

set it to

user_pref("browser.tabs.warnOnClose", false); // Confirm before closing multiple tabs

Remove Items from URL Bar

Long click onto the item and select remove.

To get rid of the bookmarks star, edit */chrome/userChrome.css and add:

 #page-action-buttons{
 display:none;
} 

Remove Items from Menu

Remove the 'Report broken Site' entry with adding to .mozilla/firefox/*.default-release/chrome/userChrome.css

#menu_report_broken {
    display: none !important;
}

Force Website Mobile

Some websites do not show in mobile version and are then hard to read. Press:

 ctrl + shift + m 

and select iphoneSE layout on top left.

another trick is to scale the page with:

Ctrl -
Ctrl +

PGP

Pretty Good Privacy

Since we are using desktop firefox, it is possible to use mailvelope.com to encrypt/decrypt emails in roundcube mail, which is amazing! Just follow the official setup procedure. You might have to scale your display to factor 2 to get all buttons.

Profiles

You messed with Firefox and now you get a warning on launch:

Can not load profile..

just start it with:

firefox-esr -p

and create a new profile.

Policies & Search Engine

Policies

By default, mobile-config-firefox adds a policies entry to get rid of invasive stuff. While this is a great idea it my cause some trouble for users living in non-free countries where searching the net is controlled.

To enable google search engine, you can edit:

./etc/firefox/policies/policies.json

See the original file here.

Be aware that, in a free country, it makes sense to avoid google.com as search engine!

Block Search Results

To get rid of reddit, pinterest, youtube, amazon etc. in your search results generate your own filterlist or use my list and copy it to your ublock MyFilter list.

Set Custom Search Engine

Define your preferred search scraper:

1. in about:config

look for

browser.urlbar.update2.engineAliasRefresh

and hit the + so it says true

2. go to settings menu and under search engine you find a new add button, click it and enter a private search engine:

e.g.

https://4get.bloat.cat/web?s=%s&scraper=qwant&nsfw=yes
https://4get.dorfdsl.de/web?s=%s
https://searx.oloke.xyz/search?q=%s
https://presearch.com/search?q=%s


there is SearxNG, Whoogle worth a try.

Voilà, you mode an important step in life set yourself a private, advertisement free search engine!

fuck surveilance capitalism:

"I need privacy, not because my actions are questionable, because your judgement and intentions are!"

Tips and Tricks

Hardware accelerated rendering

To make firefox on pinephone/pinetab/pb/pbp smoother you need to change layers.acceleration.force-enabled to true in about:config. To ensure that it kicked in check about:support, graphics->compositing should become OpenGL.

From Firefox 93, the legacy hardware acceleration layers have been disabled and only webrender is allowed. Webrender requires gles 3 to be able to use hardware acceleration, otherwise it will use "software webrenderer". Since Pinephone does not support gles3, from Firefox 93, the browser experience has become much worse because everything is software rendered. Fortunately firefox-esr (available from repositories and on par with security updates as the latest version) is still at v 91.6, so it is still possible to use legacy hardware acceleration layers. They are not enabled by default, to do it there is need to change two parameters in about:config, that are layers.acceleration.force-enable to true and gfx.webrender.force-disabled to true.

Scale and keyboard on wayland desktop environments

Some desktop environments do not set the env variable MOZ_ENABLE_WAYLAND. As a workaround, you can replace the default Firefox launcher with a custom one.

These commands will create firefox wrapper, which will run firefox with wayland and firefox launcher (icon in menu)

mkdir -p ~/.local/bin/
echo '#!/bin/bash'\n'MOZ_ENABLE_WAYLAND=1 firefox-esr $@' > ~/.local/bin/firefox-esr-wl
chmod +x ~/.local/bin/firefox-esr-wl
mkdir -p ~/.local/share/applications/
cp /usr/share/applications/firefox-esr.desktop ~/.local/share/applications/
sed -i 's/Exec=firefox-esr/Exec=firefox-esr-wl/g' ~/.local/share/applications/firefox-esr.desktop

Run it, then relogin

Hide tabs toolbar and navbar

Open firefox, search and install Panorama View addons (or whatever tabs view addons). Enter URL about:support, choose Open Directory at Profile Directory. Edit chrome/userChrome.css(if it doesn't exist, you can create one)

Tabs Toolbar and navbar on top screen:

/* Hide tabs toolbar on top*/
#TabsToolbar {
   visibility: collapse !important;
}

/* Hide navbar on top*/
#nav-bar {
  /* customize this value. */
  --navbar-margin: -30px;

  margin-top: var(--navbar-margin);
  margin-bottom: 0;
  z-index: -100;
  transition: all 0.3s ease !important;
  opacity: 0;
}

#navigator-toolbox:focus-within > #nav-bar,
#navigator-toolbox:hover > #nav-bar
{
  margin-top: 0;
  margin-bottom: var(--navbar-margin);
  z-index: 100;
  opacity: 1;
}

Tabs Toolbar and navbar on bottom screen:

/* Hide tabs toolbar on bottom*/
#TabsToolbar {
   visibility: collapse !important;
}

/* Hide navbar on bottom*/
#nav-bar {
  /* customize this value. */
  --navbar-margin: -30px;

  margin-top: 0;
  margin-bottom: var(--navbar-margin);
  z-index: -100;
  transition: all 0.3s ease !important;
  opacity: 0;
}

#navigator-toolbox:focus-within > #nav-bar,
#navigator-toolbox:hover > #nav-bar
{
  margin-top: var(--navbar-margin);
  margin-bottom: 0;
  z-index: 100;
  opacity: 1;
}

Customize Toolbar to edit Panorama View first icon showing on navigation bar.

See also