Closed
Bug 1307931
Opened 9 years ago
Closed 8 years ago
Make urls in output clickable
Categories
(DevTools :: Console, enhancement, P1)
DevTools
Console
Tracking
(firefox57 verified)
| Tracking | Status | |
|---|---|---|
| firefox57 | --- | verified |
People
(Reporter: linclark, Assigned: nchevobbe)
References
Details
(Whiteboard: [reserve-console-html])
Attachments
(2 files, 1 obsolete file)
Originally posted by:linclark
see https://github.com/devtools-html/gecko-dev/issues/348
In the current web console, clicking on URLs will open the link.
Tests:
- [ ] browser_webconsole_clickable_urls.js
| Reporter | ||
Updated•9 years ago
|
Priority: -- → P2
Whiteboard: new-console
Updated•9 years ago
|
Blocks: enable-new-console
| Reporter | ||
Comment 2•9 years ago
|
||
Honza, do you think this is something that should happen at the Reps level? For example, if there's a URL in JSON Viewer or debugger, should it also be clickable?
If so, what do you think would be the best course? Maybe do a similar thing as we have with Variables View, were if you pass in a handler function then it will be used as an onClick handler for a URL?
Flags: needinfo?(odvarko)
Comment 3•9 years ago
|
||
(In reply to Lin Clark [:linclark] from comment #2)
> Honza, do you think this is something that should happen at the Reps level?
> For example, if there's a URL in JSON Viewer or debugger, should it also be
> clickable?
Yes
> If so, what do you think would be the best course? Maybe do a similar thing
> as we have with Variables View, were if you pass in a handler function then
> it will be used as an onClick handler for a URL?
Passing a handler function in as a prop sounds good to me.
I am seeing two options:
1) Pass in a new prop e.g. 'urlLink' that opens a new tab.
2) Reuse the existing 'objectLink' prop and make it smart in a way the it knows what the user clicked on and whether the variables view (object inspector) or a new tab should be opened.
I tend to think that #2 is better, but the implementation should be nice & clean.
Also note that there is an existing report - bug 1245303, that has also a suggested patch that modifies the StringRep.
Honza
Flags: needinfo?(odvarko)
| Reporter | ||
Comment 4•9 years ago
|
||
Just realizing that this will potentially break given the console perf enhancement that we discussed on Monday. If we cache the results of reps as HTML, then we can't easily use click handlers on anything inside of reps.
| Assignee | ||
Comment 5•9 years ago
|
||
It looks like gamakichi on IRC started working on this and has a patch ready for review (https://pastebin.mozilla.org/8929855), but they are not there anymore and I can't find its bugzilla account (I don't know if they have one). Consider that this bug is assigned for now.
Updated•9 years ago
|
Flags: qe-verify+
Priority: P2 → P3
Whiteboard: new-console → [reserve-new-console]
Updated•9 years ago
|
QA Contact: iulia.cristescu
Updated•9 years ago
|
Whiteboard: [reserve-new-console] → [reserve-console-html]
| Assignee | ||
Updated•8 years ago
|
Updated•8 years ago
|
Status: NEW → ASSIGNED
Iteration: --- → 57.1 - Aug 15
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 8•8 years ago
|
||
Brian, I copied devtools/client/webconsole/test/browser_webconsole_clickable_urls.js over the new console directory for this, but I ended up simplifying the tests quite a bit. Does it still make sense to have it "copied" in the repo, or should I just create a new file ?
Comment 9•8 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #8)
> Brian, I copied
> devtools/client/webconsole/test/browser_webconsole_clickable_urls.js over
> the new console directory for this, but I ended up simplifying the tests
> quite a bit. Does it still make sense to have it "copied" in the repo, or
> should I just create a new file ?
I think copying is fine
Comment 10•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8893408 [details]
Bug 1307931 - Make urls in output clickable; .
https://reviewboard.mozilla.org/r/164522/#review170076
Looks good to me
Attachment #8893408 -
Flags: review?(bgrinstead) → review+
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•8 years ago
|
Attachment #8893407 -
Attachment is obsolete: true
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Comment 14•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8893408 [details]
Bug 1307931 - Make urls in output clickable; .
https://reviewboard.mozilla.org/r/164522/#review172304
::: devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_clickable_urls.js:24
(Diff revision 3)
> -
> - // 1: URL opens page using https when clicked.
> - {
> - input: "'https://example.com'",
> - output: "https://example.com",
> - expectedTab: "https://example.com/",
> + });
> +
> + let node = await waitFor(() => findMessage(hud, url));
> + const link = node.querySelector("a.url");
> +
> + const onTabLoaded = new Promise(resolve => {
Looks like there's a `BrowserTestUtils.waitForNewTab(gBrowser, url, true)` that wraps up this boilerplate around the tabContainer and browserLoaded.
Comment 15•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8895846 [details]
Bug 1307931 - devtools reps: update bundle to v0.12.1.
https://reviewboard.mozilla.org/r/167136/#review172306
Looks like there are some try failures but r=me with those addressed
Attachment #8895846 -
Flags: review?(bgrinstead) → review+
| Assignee | ||
Comment 16•8 years ago
|
||
| mozreview-review-reply | ||
Comment on attachment 8893408 [details]
Bug 1307931 - Make urls in output clickable; .
https://reviewboard.mozilla.org/r/164522/#review172304
> Looks like there's a `BrowserTestUtils.waitForNewTab(gBrowser, url, true)` that wraps up this boilerplate around the tabContainer and browserLoaded.
Thanks for the tip, test looks cleaner with it.
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 20•8 years ago
|
||
> Looks like there are some try failures but r=me with those addressed
I fixed the issues and pushed to TRY again
| Assignee | ||
Comment 21•8 years ago
|
||
Comment 22•8 years ago
|
||
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/87afcda8a0ff
devtools reps: update bundle to v0.12.1. r=bgrins
https://hg.mozilla.org/integration/autoland/rev/dc8e54688912
Make urls in output clickable; r=bgrins.
Comment 23•8 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/87afcda8a0ff
https://hg.mozilla.org/mozilla-central/rev/dc8e54688912
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Comment 24•8 years ago
|
||
(In reply to Jan Honza Odvarko [:Honza] from comment #3)
>
> I am seeing two options:
>
> 1) Pass in a new prop e.g. 'urlLink' that opens a new tab.
> 2) Reuse the existing 'objectLink' prop and make it smart in a way the it
> knows what the user clicked on and whether the variables view (object
> inspector) or a new tab should be opened.
>
> I tend to think that #2 is better, but the implementation should be nice &
> clean.
>
I understand that the second option was chosen. In that case, can you please detail what is the expected behaviour? In what cases the variable view and a new tab are opened?
Flags: needinfo?(odvarko)
| Assignee | ||
Comment 25•8 years ago
|
||
Hello Iulia,
We don't have the concept of the variable view anymore in the console, so I thin comment 3 is obsolete.
This bug is only about being able to click on a URL when one is logged (e.g. with `console.log("http://www.google.com")`).
Clicking on the link should always open a new tab.
Flags: needinfo?(odvarko)
Comment 26•8 years ago
|
||
Thanks Nicolas for your quick answer!
Managed to reproduce the initial issue on 52.0a1 (2016-10-22). I can confirm the bug is verified fixed on 57.0a1 (2017-08-22), using Windows 10 x64, Ubuntu 16.04 x64 and Mac OS X 10.11.6.
Updated•8 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•