Release 4.2.0

Features:
 * Hide minimize/maximize/close buttons (MR 39)
 * autoconfig: set media.webrtc.camera.allow-pipewire (MR 38)
 
 Other:
 * README: update supported versions
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEVuhTDbWL3IASV/XwWuf1UT4IhcsFAmUH7NUACgkQWuf1UT4I
 hctcwQ/+NRyPe1mBvmRP9nqhhvNFw8nz6eTBe9oEzokI5DsTcgcW41y5JxRR3Wek
 iG2cwePfrAgEKEZYP67lYEizULTeAMv0st+t4c4D2a9c4WVBVVOLXQf5e9C0CviM
 H/hfHQWfflTIv9KrG2850wuBdLQC6eRsD1BR0gagnMyS6oo7mD8GmTUfyuj1XCic
 yAnBvf51MlI2z1aYyZb2yRmjaVjY4bNe1ECmQNCyxPlyPw6dRNL+hd45y5AEZEHE
 99zSIKqmGe5KocP93ZxcgPAjQBGW1htxbiKpQXOrk6UV06byGhyf0SzpLnq5GSD7
 76N3Loxh+Fe0gbJao1EluGo2yaUUX1mkoonu9Q6LQJ0HSyVRTD4f5Twu2/K3oqH6
 lLkj0ysMY3yguBg4UX7qx4LQkUpoGdG/XWDky8oxInXOIFuJf2R0dxiU8u44IfLR
 U5l4qFBklQFDyYYD/CJPIRIQDUJogxDp4T6p8EvA/8GMS8M+5UTftyJGnaR10l9Q
 X7dIHu+dbwNkfpQ1WAJKr+LXsl2LjlIRNoIpMBaYzggfdz9F94lad8xBzTvTkLHK
 ntGsx45w2LedronJiPKJfL59L/FoPMxSU5xEg3AvhLtKncD3IwTOmJqZLMjG2xPJ
 zx8Av7a6ML/im2fMzMPOIGYTGSUZ1ux6tEtHRkOnITKJ0GrmV+A=
 =vVzW
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEJkCsxybnOIqyroEaeqZ957cxOc4FAmVRIjgACgkQeqZ957cx
 Oc7Gww//XFnz5icUuCM24ZJdki0+lRrknKqng72R/99L08JEy6RS4vZbWt1UJN8I
 R2Q+aca+HympnCAmI60XyANF6QrtUgyGKJen6JeA2Pxzd8nPVfy2NRUY6mjkdDXx
 JOGNvGme3WqQCFFI8KAujH8HQ4Kw1m7LQ/DOq5W6AqaxaidhgCeaotrVnrWJcc5Q
 zVWAyYuMLCud9+Q/4jjtzvoLEM2QosdZX9s5iS2NKd1VBRLQ8iE3qONKR0SWK4QV
 C3HE9VBQOtgUh2Zl9XFBjOFyHUEosmMCAz4LgsfQVMQtUXi4I2kNpBkB/BiyAW0A
 kN62ZvDK0wUXpCXHfIOxREuDkZL1XSx0tfp6JtQF9K3eijglCrbEpMB9KzunglUc
 mlUIl0bZhXy9IndktiFg0aKRCO2fswmwWrS0kc4LPntR2z8Cgja7DN2LZh198s+p
 vQIzcWaECnVN5XO394pLmyEFU+CwROU7n4x/JqBFwBZuHyr6MS2/eXeUOLX49Toz
 URlOH5uohni0yxVyUh567vXE2opm5X0L2OfN1b0rYBPDyMSvpz/s2rxay3BCyNKb
 uXBWkTI7xONqqwipVfsYNyIJro4l0xu/3uf9CAycXspan6RPx349enAtbAaoYh+s
 02sv2mcMkSJ5q1578CaS1lBTt0WkCYegedxP6Df1QtwGhzKDtM8=
 =lm/S
 -----END PGP SIGNATURE-----

Merge tag '4.2.0' into librem5-mirror

Release 4.2.0

Features:
* Hide minimize/maximize/close buttons (MR 39)
* autoconfig: set media.webrtc.camera.allow-pipewire (MR 38)

Other:
* README: update supported versions
This commit is contained in:
Claudia Pellegrino 2023-11-12 20:06:01 +01:00
commit f036c507eb
5 changed files with 57 additions and 22 deletions

View file

@ -1,6 +1,7 @@
# Mobile-Friendly Firefox Customizations for Librem 5 (mirror)
Mobile and privacy friendly configuration for Firefox >= 91.
Mobile and privacy friendly configuration for current standard and extended
support releases of Firefox.
This **read-only mirror** is tracking all changes posted by `@user0` in the thread [Mobile-Friendly Firefox Customizations for Librem 5](https://forums.puri.sm/t/20313) on Purisms forums.
@ -22,7 +23,6 @@ repository also does not replace a proper implementation in
* Adapt UI elements and "about:" pages to small screen sizes (when opened on
small screen)
* Enable mobile gestures
* User agent set to same as Tor Browser for Android
* Privacy tweaks:
* Disable search suggestions
* Disable Firefox studies
@ -109,10 +109,10 @@ changes are applied.
The `src/mobile-config-autoconfig.js` script generates `userChrome.css` and
`userContent.css` while Firefox starts. It logs to your Firefox profile
directory, find the log file with:
directory, follow the log file with:
```
$ find ~/.mozilla -name mobile-config-firefox.log
$ tail -F $(find ~/.mozilla -name mobile-config-firefox.log)
```
## Coding guidelines

View file

@ -18,7 +18,7 @@
// https://web.archive.org/web/20201018211550/https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Code_snippets/File_I_O
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
const Services = globalThis.Services || Cu.import("resource://gre/modules/Services.jsm").Services; // for compatibility with FF < 104
Cu.import("resource://gre/modules/FileUtils.jsm");
var g_ff_version;
@ -71,12 +71,7 @@ function log_obj(obj) {
}
function get_firefox_version() {
try {
return Services.appinfo.lastAppVersion.split(".")[0];
} catch(e) {
log("Couldn't get Firefox version (expected on first start): " + e);
return 0;
}
return Services.appinfo.version.split(".")[0];
}
function get_firefox_version_previous() {
@ -250,10 +245,7 @@ function css_files_update() {
var file = css_file_get(name);
if (file.exists()) {
/* During the very first start, ff_previous is first "unknown",
* then the files get installed and Firefox gets restarted.
* Then ff_previous is 0. Don't restart it again. */
if (ff_previous != 0 && g_ff_version != ff_previous) {
if (g_ff_version != ff_previous) {
log("Removing outdated file: " + file.path + " (Firefox" +
" version changed)");
file.remove(false);
@ -271,10 +263,30 @@ function css_files_update() {
set_firefox_version_previous(g_ff_version);
}
/**
* Builds a user-agent as similar to the default as possible, but with "Mobile"
* inserted into the platforms section.
*
* @returns {string}
*/
function build_user_agent() {
var appinfo = Services.appinfo;
var vendor = appinfo.vendor || "Mozilla";
var os = appinfo.OS || "Linux";
var version = get_firefox_version() + ".0";
var name = appinfo.name || "Firefox";
var arch = (appinfo.XPCOMABI && appinfo.XPCOMABI.includes("-"))
? appinfo.XPCOMABI.split("-")[0]
: "aarch64";
return `${vendor}/5.0 (X11; ${os} ${arch}; Mobile; rv:${version}) Gecko/20100101 ${name}/${version}`;
}
function set_default_prefs() {
log("Setting default preferences");
// Select a mobile user agent for firefox (same as tor browser on android)
defaultPref('general.useragent.override', 'Mozilla/5.0 (Android 10; Mobile; rv:110.0) Gecko/110.0 Firefox/110.0');
var user_agent = build_user_agent();
defaultPref('general.useragent.override', user_agent);
// Do not suggest facebook, ebay, reddit etc. in the urlbar. Same as
// Settings -> Privacy & Security -> Address Bar -> Shortcuts. As
@ -297,6 +309,12 @@ function set_default_prefs() {
// shows recently closed tabs. The always pinned tab takes up screen estate
// and it's slightly annoying if you do not want to register an account.
defaultPref('browser.tabs.firefox-view', false);
// FF >= 116 allows to use cameras via Pipewire. While it will likely still
// take a while until this is made the default, on most mobile devices it
// makes a lot of sense to enable it unconditionally, as cameras usually
// only work with libcamera, not via plain v4l2.
defaultPref('media.webrtc.camera.allow-pipewire', true);
}
function main() {

View file

@ -1,10 +1,11 @@
/* Copyright 2022 plata
* SPDX-License-Identifier: MPL-2.0 */
/* Move navigation bar to bottom */
@media (max-width: 700px) {
/* Move navigation bar to bottom */
#browser {
-moz-box-ordinal-group: 0 !important;
-moz-box-ordinal-group: 0 !important; /* before FF 113 */
order: -1 !important; /* since FF 113 */
}
/* Hide navigation bar in kiosk mode (to prevent bug #29). We can assume FF

View file

@ -61,7 +61,8 @@
/*max-height: 300px !important;
/* When messing around with tabs, it gets into a state where it does
* not use the whole height anymore, it becomes a tiny window. Removing
* this attribute fixes it. */
* this attribute fixes it. Since FF 113, this no longer has any
* effect, but it doesn't seem to be necessary either. */
/*-moz-box-flex: initial !important;
}*/
@ -72,13 +73,19 @@
/*overflow-y: hidden !important;
}*/
#allTabsMenu-multiView box.panel-viewstack {
#allTabsMenu-multiView box.panel-viewstack { /* before FF 102 or earlier */
/* Use the whole height */
height: calc(100vh - 100px) !important;
max-height: calc(100vh - 100px) !important;
}
#customizationui-widget-multiview box.panel-viewstack { /* since FF 113 */
/* Use the whole height */
height: 300px !important;
max-height: 300px !important;
}
#allTabsMenu-allTabsViewTabs {
#allTabsMenu-allTabsViewTabs, /* before FF 106 */
#allTabsMenu-allTabsView-tabs { /* since FF 106 */
/* Make sure tabs with long titles don't exceed the all tabs menu */
width: 0;
max-width: calc(100vw - 20px);

View file

@ -4,6 +4,7 @@
/* Reduce minimum window width */
#urlbar-container {
min-width: 150px !important;
flex-shrink: 1 !important;
}
@media (max-width: 700px) {
@ -82,6 +83,14 @@
#PersonalToolbar {
display: none;
}
/* If the bookmarks toolbar is configured to only show on the new tab page,
* Firefox makes the toolbar overlap the browser. When it's then hidden by
* the rule above, the urlbar is pushed off the bottom of the window. To
* prevent this, set the height of the overlapped toolbar to 0. */
:root {
--bookmarks-toolbar-overlapping-browser-height: 0 !important;
}
}
/* Even though amazon is removed as search engine in policies.json, it gets