Skip to content

Commit 05dcc17

Browse files
konradkdarkwing
authored andcommitted
Respect enable extenstions setting in Sources and QuickOpenModal (firefox-devtools#7705)
1 parent f826ebc commit 05dcc17

12 files changed

Lines changed: 168 additions & 6 deletions

File tree

src/actions/breakpoints/tests/__snapshots__/breakpoints.spec.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Array [
7575
"error": undefined,
7676
"id": "a",
7777
"isBlackBoxed": false,
78+
"isExtension": false,
7879
"isPrettyPrinted": false,
7980
"isWasm": false,
8081
"loadedState": "loaded",
@@ -166,6 +167,7 @@ Array [
166167
"error": undefined,
167168
"id": "a",
168169
"isBlackBoxed": false,
170+
"isExtension": false,
169171
"isPrettyPrinted": false,
170172
"isWasm": false,
171173
"loadedState": "loaded",

src/actions/sources/tests/__snapshots__/prettyPrint.spec.js.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Object {
77
"id": "base.js/originalSource-36c718d4bde9a75edb388ff7733efe7f",
88
"introductionUrl": null,
99
"isBlackBoxed": false,
10+
"isExtension": false,
1011
"isPrettyPrinted": true,
1112
"isWasm": false,
1213
"loadedState": "loaded",

src/components/PrimaryPanes/SourcesTreeItem.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import actions from "../../actions";
2020

2121
import {
2222
isOriginal as isOriginalSource,
23-
getSourceQueryString
23+
getSourceQueryString,
24+
isUrlExtension
2425
} from "../../utils/source";
2526
import { isDirectory } from "../../utils/sources-tree";
2627
import { copyToTheClipboard } from "../../utils/clipboard";
@@ -65,7 +66,7 @@ class SourceTreeItem extends Component<Props, State> {
6566
return <AccessibleImage className="webpack" />;
6667
} else if (item.path === "ng://") {
6768
return <AccessibleImage className="angular" />;
68-
} else if (item.path.startsWith("moz-extension://") && depth === 0) {
69+
} else if (isUrlExtension(item.path) && depth === 0) {
6970
return <AccessibleImage className="extension" />;
7071
}
7172

src/components/PrimaryPanes/tests/__snapshots__/SourcesTree.spec.js.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ exports[`SourcesTree on receiving new props updates highlighted items updates hi
126126
"error": undefined,
127127
"id": "server1.conn13.child1/41",
128128
"isBlackBoxed": false,
129+
"isExtension": false,
129130
"isPrettyPrinted": false,
130131
"isWasm": false,
131132
"loadedState": "unloaded",
@@ -146,6 +147,7 @@ exports[`SourcesTree on receiving new props updates highlighted items updates hi
146147
"error": undefined,
147148
"id": "server1.conn13.child1/42",
148149
"isBlackBoxed": false,
150+
"isExtension": false,
149151
"isPrettyPrinted": false,
150152
"isWasm": false,
151153
"loadedState": "unloaded",
@@ -164,6 +166,7 @@ exports[`SourcesTree on receiving new props updates highlighted items updates hi
164166
"error": undefined,
165167
"id": "server1.conn13.child1/42/originalSource-sha",
166168
"isBlackBoxed": false,
169+
"isExtension": false,
167170
"isPrettyPrinted": false,
168171
"isWasm": false,
169172
"loadedState": "unloaded",
@@ -182,6 +185,7 @@ exports[`SourcesTree on receiving new props updates highlighted items updates hi
182185
"error": undefined,
183186
"id": "server1.conn13.child1/39",
184187
"isBlackBoxed": false,
188+
"isExtension": false,
185189
"isPrettyPrinted": false,
186190
"isWasm": false,
187191
"loadedState": "unloaded",
@@ -200,6 +204,7 @@ exports[`SourcesTree on receiving new props updates highlighted items updates hi
200204
"error": undefined,
201205
"id": "server1.conn13.child1/41",
202206
"isBlackBoxed": false,
207+
"isExtension": false,
203208
"isPrettyPrinted": false,
204209
"isWasm": false,
205210
"loadedState": "unloaded",
@@ -218,6 +223,7 @@ exports[`SourcesTree on receiving new props updates highlighted items updates hi
218223
"error": undefined,
219224
"id": "server1.conn13.child1/40",
220225
"isBlackBoxed": false,
226+
"isExtension": false,
221227
"isPrettyPrinted": false,
222228
"isWasm": false,
223229
"loadedState": "unloaded",

0 commit comments

Comments
 (0)