New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 734556 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue 781030
Owner:
Last visit > 30 days ago
Closed: Nov 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Can not reliable format minified javascript

Reported by coll...@gmail.com, Jun 19 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

Steps to reproduce the problem:
1. nexus 5 chrome 59.0.3029.83
2. navigate to a webpage with minified javascript
3. try format javascript in sources tab in linux 58.0.3029.110 chrome browser

What is the expected behavior?
script got formatted

What went wrong?
no thing happens. a net_fail error is shown in inspector of inspector

Did this work before? No 

Chrome version: 58.0.3029.110  Channel: stable
OS Version: 14.04
Flash Version: 

I mistaken post a patch to https://bugs.chromium.org/p/chromium/issues/detail?id=670874&can=2&start=0&num=100&q=component%3APlatform%3EDevTools%3EJavaScript%20&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified&groupby=&sort=
 

Comment 1 by coll...@gmail.com, Jun 19 2017

This bug is reproducible in our workspace (linux ubuntu dev for mobile UC & chrome).
The rootcause is in appcache.cc.
Since some unkown (for me) version, devtools start sending formatter_worker.js request with both query string and ref string.
But even the latest chromium code in appcache.cc doesn't strip out query parts.

A simple patch is suggested in attachment. ^_

Chrome_Bug_Formatter.png
535 KB View Download
ri_chrome_bug.diff
1.9 KB Download
Status: (was: Unconfirmed)
I think we send the query string to the formatter_worker intentionally. Can you provide us a repro case (e.g. you can use jsfiddle or any other code snippet site)?
Status: Unconfirmed

Comment 4 Deleted

Comment 5 by coll...@gmail.com, Jun 20 2017

Yes, maybe the root cause is in 'serve_rev'

the request url is
chrome-devtools://devtools/remote/serve_rev/@e76cc6b93d194dac46a61d88327a96a0d5cf9894/formatter_worker.js?remoteFrontend=true&dockSide=undocked

This url fail in appcache.cc's key lookup, causing the formatter worker fail to load.

Comment 6 by coll...@gmail.com, Jun 20 2017

It happens when debugging webpage for mobile browser with pc chrome.

Comment 7 by coll...@gmail.com, Jun 20 2017

If chrome send query string intentionally. The `serve_rev/' should not put formatter_worker.js into Applicache Cache manifest file in response.

Comment 8 by coll...@gmail.com, Jun 20 2017

Or at lease add a network fallback section:

# Resources that require the user to be online.
NETWORK:
*

Comment 9 by coll...@gmail.com, Jun 22 2017

One can still use format_worker.js without any code modification as below:

1. Connect your phone's inspect as usual.
2. When format worker fail to load, cut off network
3. Appcache will be disbled(the inspector front-end will be usable with help of web cache)

Labels: Needs-Milestone
Labels: TE-NeedsTriageHelp
This problem is especially prevalent for developers in China (e.g. the OP from UC Browser), where reaching formatter_worker appears to be more problematic.

Comment 13 by liyin...@gmail.com, Jun 30 2017

I reproduce this bug too.
1. open chrome for android (Chrome (59.0.3071.92))
2. visit https://m.aliexpress.com/
3. try to format sw.js in RI of chrome 58.0.3029.110 (64-bit) 
4. nothing happened.
 
Owner: chenwilliam@chromium.org
Status: Assigned (was: Unconfirmed)
Ping for chenwilliam@; any update here please? 
Mergedinto: 781030
Status: Duplicate (was: Assigned)
Sorry for the long delay. There's a fix in flight that will fix this and linked bug which have the same underlying issue:
https://chromium-review.googlesource.com/c/chromium/tools/chrome-devtools-frontend/+/762143

Comment 17 by coll...@gmail.com, Nov 16 2017

finally.

Sign in to add a comment