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)
DevTools
JSON Viewer
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)
155.43 KB,
image/png
|
Details |
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.
Comment 1•7 years ago
|
||
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
status-firefox59:
--- → unaffected
status-firefox60:
--- → unaffected
status-firefox-esr52:
--- → unaffected
Flags: needinfo?(nchevobbe)
Keywords: regression
Comment 2•7 years ago
|
||
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)
Comment 3•7 years ago
|
||
(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)
Comment 4•7 years ago
|
||
(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)
Comment 5•7 years ago
|
||
(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.
Updated•7 years ago
|
Comment 7•7 years ago
|
||
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
Comment 9•7 years ago
|
||
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();
}
},
Updated•7 years ago
|
Flags: needinfo?(nchevobbe)
Updated•6 years ago
|
Product: Firefox → DevTools
Comment 11•6 years ago
|
||
Oriol, can we close this since Bug 1540069 landed?
Flags: needinfo?(oriol-bugzilla)
Comment 12•6 years ago
|
||
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)
Updated•6 years ago
|
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.
Description
•