"Open Image in New Tab" doesn't work for inlined data: URL images
Categories
(Firefox :: Menus, defect, P3)
Tracking
()
People
(Reporter: glob, Assigned: Gijs)
References
Details
Attachments
(2 files)
STR:
- create content that has an inline SVG as a background image (see attached)
- right click on background --> "Open Image in New Tab"
Expected:
- Navigated to the background's
data:URL
Actual:
- A blank tab
Very similar to Bug 1658244 but involves opening in a background tab.
- the "Refresh" button is disabled on the new tab
- focusing the address bar and hitting Return to navigate to the url results in SVG being correctly shown
Comment 1•4 years ago
|
||
Glob: do you know when this regressed? It looks like that menu item still calls viewMeda() which does have forceAllowDataURI: true set (same fix as bug 1658244, but done in an earlier bug).
https://searchfox.org/mozilla-central/source/browser/base/content/nsContextMenu.js#1414
Is this maybe a MR2 change to context menus?
Actual:
- A blank tab
For me it's a blank tab with the data: url pre-populated in the awesomebar. As a workaround you can just hit enter to load the image. In other cases where we've blocked data: urls I think you don't get the URL showing up because that's the thing that could be phishy
Comment 2•4 years ago
|
||
Gijs: do you know of any changes to context menus that might have this result?
| Assignee | ||
Comment 3•4 years ago
|
||
(In reply to Daniel Veditz [:dveditz] from comment #2)
Gijs: do you know of any changes to context menus that might have this result?
Nothing recent.
(In reply to Daniel Veditz [:dveditz] from comment #1)
It looks like that menu item still calls viewMeda() which does have
forceAllowDataURI: trueset (same fix as bug 1658244, but done in an earlier bug).
https://searchfox.org/mozilla-central/source/browser/base/content/nsContextMenu.js#1414
The forceAllowDataURI isn't working though, the console reports:
Navigation to toplevel data: URI not allowed (Blocked loading of: “data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUwMCIg...”)
Is this maybe a MR2 change to context menus?
Well, before MR2 there is no "open image in a new tab" item at all, there's only "view background image". So I guess nominally this "broke" with bug 1690030 - but long before that, if you tried middle-clicking or cmd/ctrl-clicking "view background image", that also didn't work. The issue is that the code here: https://searchfox.org/mozilla-central/rev/4f9bbbe5487da6d1c3680488e016f7bb0cbaa128/browser/base/content/utilityOverlay.js#596,616-618 only adds the load flag for images opened in the "current" tab, not for images opened in new tabs. To fix that, we'd need to add a flag to addTab and ensure we pass it from the context menu cases into openLinkIn and friends, through to tabbrowser.
| Assignee | ||
Comment 4•4 years ago
|
||
(In reply to Daniel Veditz [:dveditz] from comment #1)
For me it's a blank tab with the
data:url pre-populated in the awesomebar. As a workaround you can just hit enter to load the image. In other cases where we've blocked data: urls I think you don't get the URL showing up because that's the thing that could be phishy
I don't know if you want to file some kind of separate bug for this? It's the user opening the URI so I don't think it's bad, but perhaps there are other cases - I dunno off-hand.
Comment 5•4 years ago
|
||
Not a separate bug, I'm just reporting symptoms in case it's a clue. 1) confirming glob's report that the menu is broken (image not shown), but also 2) this is not the behavior I'd expect if we were intentionally blocking the data: url (blank out the address). Maybe this is some kind of in-between state?
Updated•4 years ago
|
Comment 6•3 years ago
|
||
I'm still seeing this on Mastodon - STRs are, be on Mastodon.social (logged in) -> right-click the elephant in the lower left, choose "open image in a new tab."
Result is "data:image/svg+xml;utf8,<svg ...." in the URL bar of the new tab and no image.
| Assignee | ||
Comment 7•3 years ago
|
||
I have a fix, just fighting automated tests.
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 8•3 years ago
|
||
Depends on D165453
Comment 10•3 years ago
|
||
| bugherder | ||
Updated•3 years ago
|
Reproducible on a 2022-12-20 Nightly build on macOS 12 using the STR and testcase from Comment 0.
Verified as fixed on Firefox 110.0b2(build ID: 20230117185909) and Nightly 111.0a1(build ID: 20230118095131) on macOS 12, Windows 10, Ubuntu 22.
Description
•