Closed Bug 1032379 Opened 10 years ago Closed 10 years ago

Automatically black box sources whose URL ends with ".min.js"

Categories

(DevTools :: Debugger, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 33

People

(Reporter: fitzgen, Assigned: fitzgen)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

We should automatically black box sources whose URL ends with ".min.js" or "-min.js" or whatever. Probably safe to use the regexp /\bmin\.js$/
Assignee: nobody → nfitzgerald
Status: NEW → ASSIGNED
Comment on attachment 8448298 [details] [diff] [review]
blackbox-min-sources.patch

Review of attachment 8448298 [details] [diff] [review]:
-----------------------------------------------------------------

I agree that we need to do this, but some users hate this kind of automatic-behind-your-back smart behavior, as it can sometimes go wrong. I think providing a new option in the debugger UI or even just a pref to control the black-boxing could empower those users who draw the short straw.

::: toolkit/devtools/server/actors/script.js
@@ +5060,5 @@
> +   */
> +  _isMinifiedURL: function (aURL) {
> +    try {
> +      let url = Services.io.newURI(aURL, null, null)
> +        .QueryInterface(Ci.nsIURL);

Nit: indentation is off here, dots should be aligned.
Attachment #8448298 - Flags: review?(past) → review+
Attached patch blackbox-min-sources-pt2.patch (obsolete) — Splinter Review
This patch puts it behind a pref and adds an options menu item for toggling it.

Try push: https://tbpl.mozilla.org/?tree=Try&rev=46706e29285b
Attachment #8449070 - Flags: review?(past)
Comment on attachment 8449070 [details] [diff] [review]
blackbox-min-sources-pt2.patch

Review of attachment 8449070 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great, thanks!
Attachment #8449070 - Flags: review?(past) → review+
Nick, this patches failed to apply:

part1:
Hunk #4 FAILED at 5207
1 out of 4 hunks FAILED -- saving rejects to file toolkit/devtools/server/actors/script.js.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working dir
errors during apply, please fix and refresh blackbox-min-sources.patch

part2:
applying blackbox-min-sources-pt2.patch
patching file toolkit/devtools/server/actors/script.js
Hunk #4 FAILED at 5025
Hunk #5 FAILED at 5058
2 out of 5 hunks FAILED -- saving rejects to file toolkit/devtools/server/actors/script.js.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working dir
errors during apply, please fix and refresh blackbox-min-sources-pt2.patch

i guess it needs rebasing or so, could you fix this ?
Keywords: checkin-needed
Rebased and squashed.
Attachment #8448298 - Attachment is obsolete: true
Attachment #8449070 - Attachment is obsolete: true
Attachment #8450309 - Flags: review+
https://hg.mozilla.org/integration/fx-team/rev/c1898a3d9674
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/c1898a3d9674
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 33
Depends on: 1327720
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.