Closed Bug 1395175 Opened 7 years ago Closed 7 years ago

Shortened Links in the JSON View are broken

Categories

(DevTools :: JSON Viewer, defect)

57 Branch
defect
Not set
normal

Tracking

(firefox-esr52 unaffected, firefox55 unaffected, firefox56 unaffected, firefox57 affected)

RESOLVED DUPLICATE of bug 1394094
Tracking Status
firefox-esr52 --- unaffected
firefox55 --- unaffected
firefox56 --- unaffected
firefox57 --- affected

People

(Reporter: rhubscher, Unassigned)

Details

If you open the following JSON with the JSON view: {"message": "Last beta version is 56.0b7 and last devedition is 56.0b6", "link": "https://product-details.mozilla.org/1.0/firefox_versions.json", "status": "missing"} You will see that the link is reduced. However if you click on it you will be redirected to the reduced version which obviously doesn't work. https://product-details.xn--0-p10i/firefox_versions.json
Has STR: --- → yes
Component: General → Developer Tools: JSON Viewer
Hi Honza, This is happening only when the link node is in collapsed mode and it is happening because of the cropLimit specified here. https://dxr.mozilla.org/mozilla-central/source/devtools/client/jsonview/components/json-panel.js#83 As part of https://bugzilla.mozilla.org/show_bug.cgi?id=1347833, we changed to have the cropLimit defaulting to 1024. Hence I feel that we can safely remove { cropLimit: 50 } from Line83 which would solve the issue. Your thoughts on the same?
Flags: needinfo?(odvarko)
(In reply to Abhinav Koppula from comment #1) > Hi Honza, > This is happening only when the link node is in collapsed mode and it is > happening because of the cropLimit specified here. > https://dxr.mozilla.org/mozilla-central/source/devtools/client/jsonview/ > components/json-panel.js#83 > > As part of https://bugzilla.mozilla.org/show_bug.cgi?id=1347833, we changed > to have the cropLimit defaulting to 1024. > Hence I feel that we can safely remove { cropLimit: 50 } from Line83 which > would solve the issue. The new crop-limit (from bug 1347833) is related to properties-view.js (devtools/client/netmonitor/src/components/properties-view.js) which is not used by the JSON Viewer. Instead of increasing the crop limit we could rather solve the basic issue and not open cropped link. The underlying StringRep [1] has `openLink` property and we could use that to provide 'smart' implementation understanding that clicking on cropped link dosn't use the cropped text as the URL, but the original value passed into StringRep. The implementation could be also part of StringRep object, so this issue is fixed across the DevTools UI. @Nicolas, what do you think? Honza [1] https://github.com/devtools-html/devtools-core/blob/master/packages/devtools-reps/src/reps/string.js#L89
Flags: needinfo?(odvarko) → needinfo?(nchevobbe)
Hello everyone, The work for that is tracked on the Reps repo on github : https://github.com/devtools-html/devtools-core/issues/616 . IMO We should keep the crop limit as it is and fix how we build the href attribute.
Flags: needinfo?(nchevobbe)
Yes, please don't hack around the issue by changing the crop limit. A similar issue used to affect URL-containing attributes in the DOM inspector; correcting it everywhere such contractions/truncations are made would be great.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.