Preinstall Browser Integration into Firefox

Sets up the plumbing to use Firefox policies, and uses this to preinstall Plasma Browser Integration into Firefox.

See https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson for the mechanism that provides this functionality.
This commit is contained in:
Thomas Duckworth
2025-11-04 13:46:37 +11:00
parent 28e2246bcf
commit 0e69ccf513
3 changed files with 19 additions and 0 deletions

View File

@@ -49,3 +49,8 @@ SPDX-License-Identifier = "GPL-2.0-only"
path="mkosi.extra/usr/lib/udev/hwdb.d/20-sane.hwdb"
SPDX-FileCopyrightText = "none"
SPDX-License-Identifier = "GPL-2.0-only"
[[annotations]]
path = "mkosi.extra/usr/share/firefox-config/policies.json"
SPDX-FileCopyrightText = "2025 Thomas Duckworth <tduck@filotimoproject.org>"
SPDX-License-Identifier = "GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL"

View File

@@ -36,3 +36,10 @@ if nvidia-smi > /dev/null 2>&1; then
else
rm -rf "/var/lib/flatpak/extension/org.mozilla.firefox.systemconfig/${RUNTIME_ARCH}/stable/defaults/pref/00-kde-linux-default.js"
fi
# Install the KDE Linux default Firefox policy into the Firefox flatpak system config extension.
# This installs the Plasma Browser Integration extension.
# This, however, has the unfortunate side effect of causing Firefox to show a "Your browser is being managed by your organization" message in the settings.
# See https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson
mkdir -p "/var/lib/flatpak/extension/org.mozilla.firefox.systemconfig/${RUNTIME_ARCH}/stable/policies/"
cp -rf "/usr/share/firefox-config/policies.json" "/var/lib/flatpak/extension/org.mozilla.firefox.systemconfig/${RUNTIME_ARCH}/stable/policies/policies.json"

View File

@@ -0,0 +1,7 @@
{
"policies": {
"Extensions": {
"Install": ["https://addons.mozilla.org/firefox/downloads/latest/plasma-integration/"]
}
}
}