Jump to content

Firefox: Difference between revisions

From postmarketOS Wiki
Make clear ~/.config/gtk-3.0/settings.ini should be created if it doesn't yet exist, too many people are just skipping this step if they find out the directory doesn't exist yet.
Anjanmomi (talk | contribs)
added wayland note
Line 2: Line 2:
[[File:Nexus5-Firefox.jpg|thumb|right|frame|none|alt=Alt text|Firefox running on plasma-mobile]]
[[File:Nexus5-Firefox.jpg|thumb|right|frame|none|alt=Alt text|Firefox running on plasma-mobile]]
== Firefox ==
== Firefox ==
Install {{aport|firefox}} or {{aport|firefox-esr}} package from alpine. {{aport|firefox-esr}} right now is much more adaptive to smaller screens compared to {{aport|firefox}}.
Install {{aport|firefox}} or {{aport|firefox-esr}} package from alpine. {{aport|firefox-esr}} right now is much more adaptive to smaller screens on wayland when compared to {{aport|firefox}}.


Firefox is available from armv7 architecture. armhf is unsupported at this moment.
Firefox is available from armv7 architecture. armhf is unsupported at this moment.

Revision as of 21:26, 27 May 2020

This page explains how to make firefox usable in mobile UIs like plasma-mobile.

Alt text
Firefox running on plasma-mobile

Firefox

Install firefox or firefox-esr package from alpine. firefox-esr right now is much more adaptive to smaller screens on wayland when compared to firefox.

Firefox is available from armv7 architecture. armhf is unsupported at this moment.

Specific firefox config

Go in your profile directory (.mozilla/firefox/xxxxxxxx.default/) then exec:

echo 'user_pref("dom.w3c.touch_events.enabled", true);' >> prefs.js
echo 'user_pref("browser.gesture.pinch.in", "cmd_fullZoomReduce");' >> prefs.js
echo 'user_pref("browser.gesture.pinch.out", "cmd_fullZoomEnlarge");' >> prefs.js
echo 'user_pref("general.useragent.site_specific_overrides", false );' >> prefs.js
echo 'user_pref("general.useragent.override", "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.65 Safari/537.361");' >> prefs.js

And restart the browser.

Configuration on gtk

Edit ~/.config/gtk-3.0/settings.ini (create it if it doesn't yet exist) with:

[Settings]
gtk-icon-theme-name = Paper
gtk-cursor-theme-name = Paper
gtk-fallback-icon-theme = Gnome
gtk-font-name = Sans 10
gtk-cursor-theme-size = 0
gtk-toolbar-style = GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size = GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images = 0
gtk-menu-images = 1
gtk-enable-event-sounds = 1
gtk-enable-input-feedback-sounds = 1
gtk-xft-antialias = 1
gtk-xft-hinting = 0
gtk-xft-hintstyle = hintfull
gtk-xft-rgba = rgb

Make sure to install gnome-icon-theme and paper-icon-theme packages

You may ajust Font size for your screen.

Environment variables for starting Firefox

You can start firefox with:

MOZ_USE_XINPUT2=1 GDK_SCALE=3  firefox %u

You may ajust scale to your device screen size, but it may only be integers.

You can edit your desktop shortcut /usr/share/applications/firefox.desktop :

[Desktop Entry]
Exec=env MOZ_USE_XINPUT2=1 GDK_SCALE=3  firefox %u
...

If you are running a wayland user interface (phosh, plasma mobile, etc.), you may also enable experimental wayland support by adding MOZ_ENABLE_WAYLAND=1 before firefox in the Exec line. This makes firefox run without Xwayland and may result in a better experience.

User agent

If you would like to switch between mobile and desktop page editions easily, the User Agent switcher extension will allow for easy switching between different user agents.

Upcoming versions

With upcoming versions (> 55) we will be able to use the multi-touch zoom extension to get fluid zooming. https://github.com/haxiomic/firefox-multi-touch-zoom