Closed Bug 1447820 Opened 7 years ago Closed 6 years ago

Middle clicking links in JSON view triggers a "pop blocked" notification instead of opening the link

Categories

(DevTools :: JSON Viewer, defect, P3)

defect

Tracking

(firefox-esr52 unaffected, firefox59 unaffected, firefox60 unaffected, firefox61 fix-optional)

RESOLVED DUPLICATE of bug 1379466
Tracking Status
firefox-esr52 --- unaffected
firefox59 --- unaffected
firefox60 --- unaffected
firefox61 --- fix-optional

People

(Reporter: mythmon, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file)

When viewing a JSON document, I middle clicked a URL to view it in a new tab. Instead of opening the tab, I got a popup blocker notification. It would be nice if this worked without special steps.
This is a regression from 1440388, which replaced href attributes with JS. I wonder why. https://github.com/devtools-html/devtools-core/pull/989
Blocks: 1440388
Flags: needinfo?(nchevobbe)
Keywords: regression
This was done so the Reps consumer can decide what to do depending on what kind of url is clicked (resource: , chrome: , http: , …). The issue described in Comment 0 need to be fixed for 61
Flags: needinfo?(nchevobbe)
(In reply to Oriol Brufau [:Oriol] from comment #1) > This is a regression from 1440388, which replaced href attributes with JS. I > wonder why. > https://github.com/devtools-html/devtools-core/pull/989 Hey Oriol, may I ask how you found the regression? I can not reproduce myself (on windows, firefox 61, middle-clicking with my mouse wheel).
Flags: needinfo?(oriol-bugzilla)
(In reply to Patrick Brosset <:pbro> from comment #3) > Hey Oriol, may I ask how you found the regression? I had seen that bug used JS-based links so I already knew before bisecting. Anyways I can reproduce on windows, firefox 61. I use https://api.github.com/ to test. Make sure popups are blocked in about:preferences#privacy
Flags: needinfo?(oriol-bugzilla)
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #2) > This was done so the Reps consumer can decide what to do depending on what > kind of url is clicked But removing href is semantically bad. If then you want to handle it via JS, you can always use event.preventDefault(). This also breaks my workflow, now I can't right-click and choose "Save Link As". This is useful when the JSON links images, videos, etc.
@honza: Triage?
Flags: needinfo?(odvarko)
I can reproduce the problem. Thanks for the report! STR: 1) Make sure to block popup windows ("Block pop-up windows" checkbox needs to be checked in about:preferences#privacy) 2) Load https://api.github.com/ 3) Middle click on any link 4) A yellow notification saying that the browser prevented this site from opening a pop-up window -> BUG Honza
Has STR: --- → yes
Flags: needinfo?(odvarko)
Priority: -- → P2
@Nicolas, any tips how we could fix this? Honza
Flags: needinfo?(nchevobbe)
Just do this: 1. Add back href attributes in https://github.com/devtools-html/devtools-core/issues/1020 2. Stop using event.preventDefault() in the reps side 3. Pass the event object to openLink methods 3. Change JSON Viewer's openLink to openLink(str, event) { let u; try { u = new URL(str); } catch (ex) { /* the link might be bust */ } if (!u || !["https:", "http:"].includes(u.protocol) { event.preventDefault(); } },
Flags: needinfo?(nchevobbe)
Product: Firefox → DevTools
No activity, moving to the backlog (P3) Honza
Priority: P2 → P3
Depends on: 1540069

Oriol, can we close this since Bug 1540069 landed?

Flags: needinfo?(oriol-bugzilla)

In fact this was fixed by bug 1379466, but bug 1540069 should have done the trick too.
This can be closed unless you think a test is needed, though https://hg.mozilla.org/integration/autoland/rev/32d8c9a17e50 probably suffices.

Flags: needinfo?(oriol-bugzilla)
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: