Skip to content

Commit b725429

Browse files
AnshulMalikjasonLaster
authored andcommitted
Enable auto prettyprint pref (firefox-devtools#4770)
1 parent 04afd64 commit b725429

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/actions/sources.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,12 @@ export function selectSource(id: string, options: SelectSourceOptions = {}) {
208208
await dispatch(loadSourceText(source.toJS()));
209209
await dispatch(setOutOfScopeLocations());
210210
const src = getSource(getState(), id).toJS();
211-
if (shouldPrettyPrint(src) && isMinified(src.id, src.text)) {
211+
const { autoPrettyPrint } = prefs;
212+
if (
213+
autoPrettyPrint &&
214+
shouldPrettyPrint(src) &&
215+
isMinified(src.id, src.text)
216+
) {
212217
await dispatch(togglePrettyPrint(src.id));
213218
}
214219
})()

src/utils/prefs.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const prefsSchemaVersion = "1.0.3";
1212
const pref = Services.pref;
1313

1414
if (isDevelopment()) {
15+
pref("devtools.debugger.auto-pretty-print", true);
1516
pref("devtools.source-map.client-service.enabled", true);
1617
pref("devtools.debugger.pause-on-exceptions", false);
1718
pref("devtools.debugger.ignore-caught-exceptions", false);
@@ -39,6 +40,7 @@ if (isDevelopment()) {
3940
}
4041

4142
export const prefs = new PrefsHelper("devtools", {
43+
autoPrettyPrint: ["Bool", "debugger.auto-pretty-print"],
4244
clientSourceMapsEnabled: ["Bool", "source-map.client-service.enabled"],
4345
pauseOnExceptions: ["Bool", "debugger.pause-on-exceptions"],
4446
ignoreCaughtExceptions: ["Bool", "debugger.ignore-caught-exceptions"],

0 commit comments

Comments
 (0)