Closed Bug 1134512 Opened 9 years ago Closed 1 year ago

Support background-image with URLs in styling console

Categories

(DevTools :: Console, enhancement, P3)

37 Branch
x86
macOS
enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1579663

People

(Reporter: jsantell, Unassigned)

References

Details

bug 823097 which added styling support specifically blocks out url references and wondering if we can revisit for cool stuff like:

http://www.clicktorelease.com/tools/augmented-console/v2/
Summary: Support background-image in styling console → Support background-image with URLs in styling console
Is this trying to render a data URI or an external resource?
In this case, a canvas rendered to a data URI
The concerns in bug 823097 were security-related, but rather vague to be honest. I think we can do this if we are careful.
Yeah, we can surely allow data URIs
Product: Firefox → DevTools
Priority: -- → P3
Type: defect → enhancement

(In reply to Brian Grinstead [:bgrins] from comment #4)

Yeah, we can surely allow data URIs

From what I've just tried in Firefox 77 Data-URIs are allowed already:

console.log('red dot from datauri: %c ', `background: url("data:image/png;base64,iVBORw0KGgo\
AAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAAB\
JRU5ErkJggg==") no-repeat white center; padding: 20px; display: inline-block; border: 2px solid green;`);

↑ This currently works both in Fx and Chrome, so hypothetically you could fetch or generate image and serialize it into base64 datauri before feeding the console, but haven't tried nor seen it working in the demo.

For parity, Chrome supports displaying images "from web", even from third party origins, so ↓ this URL loading works in Chrome (coincidentally, version I tested was v.77):

console.log('image from gravatar.com: %c ', `background: url("https://secure.gravatar.com/avatar/\
70dab6b4ee5773925737dadc06911817?d=mm&size=64") no-repeat white center; padding: 20px; display: inline-block;
border: 2px solid green;`);
Severity: normal → S3

This was fixed in bug 1579663 around Firefox 73. I don't know why they didn't dupe that one here since this bug was brought up in comment 1.

Status: NEW → RESOLVED
Closed: 1 year ago
Depends on: 1579663
Resolution: --- → FIXED
Duplicate of bug: 1579663
Resolution: FIXED → DUPLICATE
You need to log in before you can comment on or make changes to this bug.