Implemented in Firefox an experimental API in WebExtensions to edit about: config

Firefox logo

An external developer has implemented an experimental API to provide WebExtensions the capacity of edit the configuration available via “about: config” in Firefox-based browsers.

The API can be useful for creating tweaker extensions that provide a more user-friendly browser customization interface. In the same repository, 2 extensions are provisioned using the forwarded API, which can serve as an example.

To get access to the API, The following conditions must be met:

  • Use a version of Firefox with the ability to run unsigned extensions (Mozilla does not essentially sign extensions that use WebExtensions Experiments) and activate this mode through “xpinstall.signatures.required”.
  • Using a version of Firefox with the ability to use WebExtensions Experiments (requires compilation with the macro definition “MOZ_DEV_EDITION”. Of the official versions, these are Nightly and Developer Edition). This mode is activated by “extensions.experiments.enabled”.
  • The presence of an installed extension that forwards the API. It is located in the “experiments” directory. It also contains a file that describes and documents the current version of the WebExtensions API for editing “about: config”. In the future, it is planned to implement limiting the available parameters for a specific API user extension by declaring them in the manifest.
  • To work with the API, you must specify the “experiment.config” permission in your extension manifest.

It should be noted that the dynamic granting (with the possibility that the user opts out) of permissions to access experimental APIs does not work in Firefox at this time.

Furthermore, it is mentioned that an extension is provided in the “arkenfox” directory that synchronizes the browser settings with the list of recommended settings for the arkenfox project (formerly known as ghacksuserjs, but renamed because the project has been developing for a long time in isolation from the Ghacks technology news site). When installed, a button appears on the toolbar, when that opens a list of configurations, whose values ​​do not match the values ​​in arkenfox / user.js. In front of each difference there is a button, by clicking on which the difference is eliminated. All differences can be removed with one click.

For the extension to work from the “arkenfox” directory, another experimental API is required, webext-experiment-parse, what allows to use the resources of the ECMAScript parser built-in SpiderMonkey, rather than using parsers implemented in ECMAScript itself, such as ESPrima, to provide better performance and more importantly, eliminate the need to submit and update this dependency.

No measurement and comparison was carried out, it is very possible that the overhead of sending messages eats everything, in a friendly way so as not to eat it you have to forward it out of the box, but at the moment Mozilla is generally against forwarding this API, since They do not guarantee the stability of the returned AST format.

However, it is possible to work without the specified extension, with a backing to a primitive parser based on regular expressions. To do this, you need to rebuild the “arkenfox” extension, removing the “experiments”.

The “unlock” extension simply unlocks all locked settings at the time of its initialization. The locked configurations are those that the user cannot change through “about: config”.

Since the custom configuration file is read at startup before the extensions are initialized, changes to the configuration locked between reboots are not saved. If it is necessary to ‘clear’ the locked setting value in the early stages of commissioning, you can lock it to another value according to the instructions.

To create extensions, you just need to compress your files into zip files uncompressed with the xpi extension. As a reminder, Mozilla did not deliberately implement editing the about: config configuration in the form of the WebExtensions API.

Finally, for those who are interested in having access to the API, they can consult the following repository where you will find everything mentioned.

Add Comment