Autoconfig doesn't work on Flatpak
Categories
(Core :: Widget: Gtk, defect, P3)
Tracking
()
People
(Reporter: hey, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
120.08 KB,
image/png
|
Details |
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.
| Reporter | ||
Comment 1•1 year ago
|
||
There's a similar issue on fx-autoconfig's repository: https://github.com/MrOtherGuy/fx-autoconfig/issues/48
Comment 2•1 year ago
|
||
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.
Comment 3•1 year ago
|
||
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/...
| Reporter | ||
Comment 4•1 year ago
|
||
Thank you very much :jhorak, using your blog, I was able to add autoconfig support to Zen: https://github.com/zen-browser/desktop/pull/10472. Now, Sine works with Zen: https://github.com/CosmoCreeper/Sine/issues/257#issuecomment-3315930873 and https://github.com/CosmoCreeper/Sine/releases/download/v2.2.2/sine-flatpak.sh
| Reporter | ||
Updated•1 year ago
|
Description
•