Open Bug 1722370 Opened 3 months ago Updated 3 months ago

Evaluate how to remove the "devtools.webextensions.ADDON_ID.enabled" prefs used as a backend for extension section of the "DevTools Settings" UI


(WebExtensions :: Developer Tools, task, P3)



(Not tracked)


(Reporter: rpl, Unassigned)



As a follow up to Bug 1722145 we would like to avoid having two different source of truth to decide if an extension should be enabled or not in the Developer Toolboxes, at the moment we do use

  • about:config prefs with the following format "devtools.webextensions.ADDON_ID.enabled" for the extension that have a "devtools_page" manifest property (and do not have a "devtools" permission explicitly listed in the optional permissions)

  • or the about:config pref and the optional permissions if the extension is explicitly listing a "devtools" permision it the "optional_permissions" manifest property

The about:config pref is what does currently allow the "DevTools Settings" UI to list the extension that provides a "devtools_page" and allow the user to enable/disable the devtools parts of the extension (without having to disable the entire extension), but after we introduced the optional permission (Bug 1606862) it started to kind of overlapping with the optional permission and having two different backends as a source of truth does increase the number of corner cases and potential bugs introduced by missing some of them.

Follows some ideas to look into when we are going to actually work on this (all of them would still need to be detailed and discussed more, e.g. looking for other potential corner cases to take care of):

  • Evaluate if the synthetic "devtools" install-time permission (the one currently unconditionally added on extension startup based on the presence of the "devtools_page" manifest key) can be changed into a a synthetic "devtools" optional permission instead, and then make the DevTools Settings UI to use the ExtensionPermissions as the only backend for the devtools extension checkboxes

  • Look if making the "devtools.webextensions.ADDON_ID.enabled" pref an extension managed settings (ExtensionPreferenceManager / ExtensionSettingsStore) would more easily allow to make sure the about:config pref is set to a value that is consistent with the optional permission granted by reusing internals we already have to maintain for the other about:config prefs managed through it

  • Evaluate if it may be acceptable to make the "DevTools Settings UI" able to turn a devtools extension on and off only if the extension is explicitly requesting "devtools" as an optional permission (in Chrome it would not be a valid optional permission, but the differences between the Firefox and Chrome manifests for the same extension would still be minimal)

Summary: Evaluate if "devtools extensions" checkboxes available in the "DevTools Settings" UI should use the "devtools" extension permission instead of an about:config pref as a backend for those settings. → Evaluate how to remove the "devtools.webextensions.ADDON_ID.enabled" prefs used as a backend for extension section of the "DevTools Settings" UI

Linking some relevant bugs:

  • bug 1394750 introduced the pref
  • bug 1722145 is the bug where this issue was discovered during code review.
  • bug 1606862 was the bug that introduced the optional permission that made the pref kind of redundant.
See Also: → 1722145, 1606862, 1394750
Severity: -- → N/A
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.