Bug 1369801 - dt-addon-prefs: move jsonview enabled pref outside of devtools addon;r=ochameau

DevTools preferences are loaded dynamically by calling DevtoolsPreferences.loadPrefs().
We can not preload them when the addon starts, otherwise this will slow down the startup
of Firefox.

But jsonview's converter-observer needs to check preferences to check if jsonview is
enabled very early. Moving devtools.jsonview.enabled to a separate preferences file
that is still processed by firefox fixes the issue.

The downside is that this pref will keep following m-c's release cycle and not the addon's.
But it is so generic it should not be a big issue.


MozReview-Commit-ID: HrD5IVe54Ks

--HG--
extra : rebase_source : 7feb021770c827996e276b60169b08093ecc1ff0
This commit is contained in:
Julian Descottes 2017-07-21 12:27:35 +02:00
Родитель 346099c99a
Коммит be3db82a6e
5 изменённых файлов: 19 добавлений и 4 удалений

Просмотреть файл

@ -138,8 +138,9 @@ devtools/shared/qrcode/tests/mochitest/test_decode.html
devtools/shared/tests/mochitest/*.html
devtools/shared/webconsole/test/test_*.html
# Ignore devtools pre-processed files
# Ignore devtools preferences files
devtools/client/preferences/**
devtools/shim/devtools-startup-prefs.js
# Ignore devtools third-party libs
devtools/shared/jsbeautify/*

Просмотреть файл

@ -630,6 +630,7 @@
; [DevTools Shim Files]
@RESPATH@/browser/chrome/devtools-shim@JAREXT@
@RESPATH@/browser/chrome/devtools-shim.manifest
@RESPATH@/browser/@PREF_DIR@/devtools-startup-prefs.js
; shell icons
#ifdef XP_UNIX

Просмотреть файл

@ -352,8 +352,5 @@ pref("devtools.editor.autocomplete", true);
// version for each user.
pref("devtools.telemetry.tools.opened.version", "{}");
// Enable the JSON View tool (an inspector for application/json documents).
pref("devtools.jsonview.enabled", true);
// Enable the HTML responsive design mode for all channels.
pref("devtools.responsive.html.enabled", true);

Просмотреть файл

@ -0,0 +1,12 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// This Devtools preferences file will be loaded as a usual Firefox preferences file.
// Most DevTools prefs are included with the addon and loaded dynamically during the addon
// startup. For preferences that are required before the addon is loaded or that we can't
// process in JS, they can be defined in this file.
// Note that this preference file follows Firefox release cycle.
// Enable the JSON View tool (an inspector for application/json documents).
pref("devtools.jsonview.enabled", true);

Просмотреть файл

@ -6,6 +6,10 @@
JAR_MANIFESTS += ['jar.mn']
JS_PREFERENCE_FILES += [
'devtools-startup-prefs.js',
]
# Register the about:debugging page only for 'addon' and 'all' builds.
if CONFIG['MOZ_DEVTOOLS'] != 'server':
EXTRA_COMPONENTS += [