Closed Bug 1982052 Opened 1 year ago Closed 1 year ago

Autoconfig doesn't work on Flatpak

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 141
defect

Tracking

()

RESOLVED INACTIVE

People

(Reporter: hey, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached image Configuration Error.png —

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:141.0) Gecko/20100101 Firefox/141.0

Steps to reproduce:

I am trying to add an autoconfig script to support fx-autoconfig.

NOTE: I am using the Zen browser, but the behaviour is mostly similar to FIrefox (Zen is a downstream of Zen, but the implementation looks similar).

Inside the Flatpak sandbox, I added the file /app/zen/defaults/pref/config-prefs.js with the following content:

pref("general.config.obscure_value", 0);
pref("general.config.filename", "config.js");
pref("general.config.sandbox_enabled", false);

And the file /app/zen/config.js with the following content:

// skip 1st line
try {

let cmanifest = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('UChrm', Ci.nsIFile);
cmanifest.append('utils');
cmanifest.append('chrome.manifest');

if(cmanifest.exists()){
Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest);
ChromeUtils.importESModule('chrome://userchromejs/content/boot.sys.mjs');
}

} catch(ex) {};

Actual results:

Firefox/Zen should load the config.js file when the browser loads, but it doesn't. Instead, it throws an error (screenshot attached), saying the config.js file could not be loaded

Expected results:

Firefox/Zen should have found and loaded the config.js file when the browser started.

There's a similar issue on fx-autoconfig's repository: https://github.com/MrOtherGuy/fx-autoconfig/issues/48

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Blocks: flatpak
Priority: -- → P3

I've written an article about the issue:
https://jhorakdevblog.wordpress.com/2023/06/22/how-to-set-firefox-enterprise-policies-and-system-preferences-under-flatpak/
Please check if that works for you. I wonder how do you add a file into the /app/zen/defaults/...

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: