As I understand, `autoconfig.js` (with `firefox.cfg`) can be used to have JavaScript run during startup to control Firefox's UI elements.
I have set up `autoconfig.js` i… (cytajśo wěcej)
As I understand, `autoconfig.js` (with `firefox.cfg`) can be used to have JavaScript run during startup to control Firefox's UI elements.
I have set up `autoconfig.js` in my `/usr/lib/firefox-developer-edition/defaults/pref` folder (I'm on EndeavourOS Linux). As instructed here, I've already put the two required files, `autoconfig.js` and `firefox.cfg` in their correct folders (`/usr/lib/firefox-developer-edition/defaults/pref` and `/usr/lib/firefox-developer-edition` in my machine).
The file `firefox.cfg` contains the following code:
//
(() => {
var tabbar = document.getElementById("TabsToolbar");
})();
However, every time I run Firefox, this message will appear:
"Failed to read the configuration file. Please contact your system administrator."
If I empty out the `firefox.cfg` file, Firefox will run normally without showing the error message. It will also run normally if I just have something like this in the file:
//
(() => {
var testVar = "";
})();
I don't understand why the JavaScript code can't access the Firefox UI elements through `document` or `window.document`. If `autoconfig.js` isn't build for that, what should I use to change my browser's UI elements through JavaScript?
Thank you.