Bug 1307881 - Part 1 - Split message persistence prefs into two, one for the netmonitor and one for the console;r=Honza

MozReview-Commit-ID: 4i8heIyPEv0

--HG--
extra : rebase_source : 2f3d35329126866b0c85d3620fb9f3d046ff3a85
This commit is contained in:
Brian Grinstead 2017-08-31 21:42:15 -07:00
Родитель 6feeb8950f
Коммит 07e14766fa
7 изменённых файлов: 31 добавлений и 23 удалений

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

@ -1740,7 +1740,7 @@ BrowserGlue.prototype = {
// eslint-disable-next-line complexity
_migrateUI: function BG__migrateUI() {
const UI_VERSION = 51;
const UI_VERSION = 52;
const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
let currentUIVersion;
@ -2110,6 +2110,14 @@ BrowserGlue.prototype = {
}
}
if (currentUIVersion < 52) {
// Keep old devtools log persistence behavior after splitting netmonitor and
// webconsole prefs (bug 1307881).
if (Services.prefs.getBoolPref("devtools.webconsole.persistlog")) {
Services.prefs.setBoolPref("devtools.netmonitor.persistlog", true);
}
}
// Update the migration version.
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
},

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

@ -41,14 +41,6 @@
<legend>&options.selectDevToolsTheme.label2;</legend>
</fieldset>
<fieldset id="commonprefs-options" class="options-groupbox">
<legend>&options.commonPrefs.label;</legend>
<label title="&options.enablePersistentLogs.tooltip;">
<input type="checkbox" data-pref="devtools.webconsole.persistlog" />
<span>&options.enablePersistentLogs.label;</span>
</label>
</fieldset>
<fieldset id="inspector-options" class="options-groupbox">
<legend>&options.context.inspector;</legend>
<label title="&options.showUserAgentStyles.tooltip;">
@ -94,6 +86,14 @@
</label>
</fieldset>
<fieldset id="netmonitor-options" class="options-groupbox">
<legend>&options.netmonitor.label;</legend>
<label title="&options.netmonitor.enablePersistentLogs.tooltip;">
<input type="checkbox" data-pref="devtools.netmonitor.persistlog" />
<span>&options.netmonitor.enablePersistentLogs.label;</span>
</label>
</fieldset>
<fieldset id="styleeditor-options" class="options-groupbox">
<legend>&options.styleeditor.label;</legend>
<label title="&options.stylesheetSourceMaps.tooltip;">

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

@ -179,17 +179,16 @@
<!ENTITY options.screenshot.audio.label "Play camera shutter sound">
<!ENTITY options.screenshot.audio.tooltip "Enables the camera audio sound when taking screenshot">
<!-- LOCALIZATION NOTE (options.commonprefs): This is the label for the heading
of all preferences that affect both the Web Console and the Network
Monitor -->
<!ENTITY options.commonPrefs.label "Common Preferences">
<!-- LOCALIZATION NOTE (options.netmonitor.label): This is the label for the
- heading of the group of Network Monitor preferences in the options panel. -->
<!ENTITY options.netmonitor.label "Network">
<!-- LOCALIZATION NOTE (options.enablePersistentLogs.label): This is the
- label for the checkbox that toggles persistent logs in the Web Console and
- network monitor, i.e. devtools.webconsole.persistlog a boolean preference in
- label for the checkbox that toggles persistent logs in the netmonitor,
- i.e. devtools.netmonitor.persistlog a boolean preference in
- about:config, in the options panel. -->
<!ENTITY options.enablePersistentLogs.label "Enable persistent logs">
<!ENTITY options.enablePersistentLogs.tooltip "If you enable this option the Web Console and Network Monitor will not clear the output each time you navigate to a new page">
<!ENTITY options.netmonitor.enablePersistentLogs.label "Enable persistent logs">
<!ENTITY options.netmonitor.enablePersistentLogs.tooltip "If you enable this option the Network Monitor will not clear the output each time you navigate to a new page">
<!-- LOCALIZATION NOTE (options.showPlatformData.label): This is the
- label for the checkbox that toggles the display of the platform data in the,

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

@ -35,7 +35,7 @@ pref("devtools.netmonitor.har.compress", false);
pref("devtools.netmonitor.har.forceExport", false);
pref("devtools.netmonitor.har.pageLoadedTimeout", 1500);
pref("devtools.netmonitor.har.enableAutoExportToFile", false);
pref("devtools.webconsole.persistlog", false);
pref("devtools.netmonitor.persistlog", false);
pref("devtools.styleeditor.enabled", true);
const { configureStore } = require("./src/utils/create-store");

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

@ -82,7 +82,7 @@ class FirefoxConnector {
}
willNavigate() {
if (!Services.prefs.getBoolPref("devtools.webconsole.persistlog")) {
if (!Services.prefs.getBoolPref("devtools.netmonitor.persistlog")) {
this.actions.batchReset();
this.actions.clearRequests();
} else {

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

@ -14,7 +14,7 @@ add_task(function* () {
let { document } = monitor.panelWin;
Services.prefs.setBoolPref("devtools.webconsole.persistlog", false);
Services.prefs.setBoolPref("devtools.netmonitor.persistlog", false);
yield reloadAndWait();
@ -28,7 +28,7 @@ add_task(function* () {
"The request list should still have two items at this point.");
// Now we toggle the persistence logs on
Services.prefs.setBoolPref("devtools.webconsole.persistlog", true);
Services.prefs.setBoolPref("devtools.netmonitor.persistlog", true);
yield reloadAndWait();
@ -36,7 +36,7 @@ add_task(function* () {
is(document.querySelectorAll(".request-list-item").length, 4,
"The request list should now have four items at this point.");
Services.prefs.setBoolPref("devtools.webconsole.persistlog", false);
Services.prefs.setBoolPref("devtools.netmonitor.persistlog", false);
return teardown(monitor);
/**

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

@ -287,10 +287,11 @@ pref("devtools.webconsole.ui.filterbar", false);
// Max number of inputs to store in web console history.
pref("devtools.webconsole.inputHistoryCount", 50);
// Persistent logging: |true| if you want the Web Console to keep all of the
// Persistent logging: |true| if you want the relevant tool to keep all of the
// logged messages after reloading the page, |false| if you want the output to
// be cleared each time page navigation happens.
pref("devtools.webconsole.persistlog", false);
pref("devtools.netmonitor.persistlog", false);
// Web Console timestamp: |true| if you want the logs and instructions
// in the Web Console to display a timestamp, or |false| to not display