Primary eng (and PM) emails
Eng: mea...@chromium.org
Summary
We intend to block web pages from loading data: URLs in the top frame using <A> tags, window.open, window.location and similar mechanisms.
Motivation
data: URLs are generally a source of confusion for users. Because of their unfamiliarity and ability to encode arbitrary untrusted content in a URL, they are widely being used in spoofing and phishing attacks. Another problem is that they can be passed along without a backing page that runs JavaScript (e.g. a data URL can be sent via email). For that reason, we intend to block top-frame navigations to data URLs.
We are considering two alternative implementations:
Alternative 1:
Block only content initiated top-frame navigations to data URLs, while still allowing direct navigations to them. Similar measures are already in place for other schemes such as “chrome:”, “chrome-devtools:” and more recently, “view-source:”.
In practice, these will be blocked:
Navigations when the user clicks on links in the form of <A HREF=”data:…”>
window.open(“data:…”)
window.location = “data:…”
Meta redirects
The following will still be allowed:
User navigating to the URL by typing or pasting it in the omnibox
Downloads from these protocols:
Via non-browser-handled MIME types
Via <A download>
Via “Save link as”
Alternative 2:
Block all top-frame navigations to data URLs. This only differs from (1) in that it will additionally block direct navigations (“User navigating to the URL by typing or pasting it in the omnibox”).
In both cases, subresources with data URLs (e.g. <img src=”data:...”>, <iframe src=”data:...”>) will be allowed.
Pros of Approach 1:
Lower risk of breakage
Cons of Approach 2:
Might be confusing to some users ("why does it work when I type the address but not when I click the link?")
We might end up playing whack-a-mole with edge cases where we don't properly block the URLs
Pros of Approach 2:
Straightforward approach, consistent with IE/Edge behavior.
Might be simpler to implement.
Cons of Approach 2:
Higher risk of breakage
Compatibility Risk
IE and Edge already block all top-frame navigations to data URLs. Firefox and Safari allow them.
If we implement (2), Chrome’s behavior will align with IE/Edge after this change.
The blocking will be similar to how chrome:// URLs are handled:
For same page navigations, clicking the link won’t do anything, and a message will be displayed in the console.
For navigations in other tabs or popups, the page will navigate to about:blank instead.
No event handlers will be triggered.
Alternative implementation suggestion for web developers
The main use case for navigating to data URLs in the top frame is generating files (HTML, PDF, images etc.) on the fly and displaying them to the user.
For that use case, these alternatives exist:
- Generate the file on the backend and send it to the user over http/https.
- Initiate a download instead of displaying the URL.
- If the contents of the URL is trusted, iframe the URL so that the omnibox displays the site's URL.
Usage information
According to latest Stable Channel metrics over the last 28 days in January 2017, data URLs are 0.05% of all top-frame navigations among all platforms, and 0.01% of all navigations on Android.
OWP launch tracking bug
OWP tracking bug: https://crbug.com/684011
Discussion: https://crbug.com/594215
Entry on the feature dashboard
https://www.chromestatus.com/feature/5669602927312896
Requesting approval to remove too?
Yes, requesting approval to block top-frame navigations to data URLs.
We are considering two alternative implementations:
Alternative 1:
Block only content initiated top-frame navigations to data URLs, while still allowing direct navigations to them. Similar measures are already in place for other schemes such as “chrome:”, “chrome-devtools:” and more recently, “view-source:”.
Alternative 2:
Block all top-frame navigations to data URLs. This only differs from (1) in that it will additionally block direct navigations (“User navigating to the URL by typing or pasting it in the omnibox”).
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
I can sympathize with the risk it entails
--
lgtm2
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Maybe the way to go is to not have this restriction for webview?
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
As others have mentioned, this looks like a fairly breaking change for various approaches to testing. For example, Intern ( http://theintern.github.io/intern/ ) uses top-level data URLs approach within its Leadfoot ( https://github.com/theintern/leadfoot ) library to run a series of feature tests using WebDriver, prior to running tests. This is to prevent user tests from triggering known WebDriver defects. I don't see either proposed alternative working in this scenario, since it's in the context of an automated testing environment.
--
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To clarify, I'm going to proceed with Approach #1 (only blocking content initiated navigations). The feedback from this thread indicates that full blockage will be too disruptive and may break legitimate use cases.> In the future we should probably have design discussions before the intent to deprecate phase. Having multiple ideas, one very extreme and one less so in the same intent makes this discussion hard to follow.We had a separate discussion before sending this intent, and listing both approaches was a decision from that discussion.Rick, Jochen, Philip: Could you please clarify that you are LGTM'ing Approach #1?> From there users can right click the element and choose "Open in a new tab" or "download" and this would break that.Downloads shouldn't be blocked in either case. In contrast, "Open in a new tab" will be broken in both cases to be consistent with the blocking of other URLs such as chrome://, view-source:// etc ("Open in a new tab/window" doesn't work with these URLs). That is, unless we make an exception for data URLs.
On Feb 6, 2017 1:51 PM, "Mustafa Emre Acer" <mea...@chromium.org> wrote:To clarify, I'm going to proceed with Approach #1 (only blocking content initiated navigations). The feedback from this thread indicates that full blockage will be too disruptive and may break legitimate use cases.> In the future we should probably have design discussions before the intent to deprecate phase. Having multiple ideas, one very extreme and one less so in the same intent makes this discussion hard to follow.We had a separate discussion before sending this intent, and listing both approaches was a decision from that discussion.Rick, Jochen, Philip: Could you please clarify that you are LGTM'ing Approach #1?> From there users can right click the element and choose "Open in a new tab" or "download" and this would break that.Downloads shouldn't be blocked in either case. In contrast, "Open in a new tab" will be broken in both cases to be consistent with the blocking of other URLs such as chrome://, view-source:// etc ("Open in a new tab/window" doesn't work with these URLs). That is, unless we make an exception for data URLs.That seems like a pretty serious breakage. A user choosing "Open in tab" on an image with a data URL src is very reasonable for an offline image editor app or photo galleries. For example Google image search even used data urls for thumbnails at one point.I don't see why choosing an option like that from a context menu (or dragging the image into the tab strip) would be different from a user pasting the URL into the omnibox.
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
OK, as long as we're going with approach #1 this probably is okay for WebView, but since we don't have metrics (or a large dev/beta population) we aren't likely to find out if this breaks a lot of WebView apps until after it ships to stable - we'll have to keep an eye on incoming bug reports for any developers/users reporting issues here.
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Primary eng (and PM) emails
Eng: mea...@chromium.org
Summary
We intend to block web pages from loading data: URLs in the top frame using <A> tags, window.open, window.location and similar mechanisms.
Motivation
data: URLs are generally a source of confusion for users. Because of their unfamiliarity and ability to encode arbitrary untrusted content in a URL, they are widely being used in spoofing and phishing attacks. Another problem is that they can be passed along without a backing page that runs JavaScript (e.g. a data URL can be sent via email). For that reason, we intend to block top-frame navigations to data URLs.
We are considering two alternative implementations:
Alternative 1:
Block only content initiated top-frame navigations to data URLs, while still allowing direct navigations to them. Similar measures are already in place for other schemes such as “chrome:”, “chrome-devtools:” and more recently, “view-source:”.
In practice, these will be blocked:
Navigations when the user clicks on links in the form of <A HREF=”data:…”>
window.open(“data:…”)
window.location = “data:…”
Meta redirects
The following will still be allowed:
User navigating to the URL by typing or pasting it in the omnibox
Downloads from these protocols:
Via non-browser-handled MIME types
Via <A download>
Via “Save link as”
Alternative 2:
Block all top-frame navigations to data URLs. This only differs from (1) in that it will additionally block direct navigations (“User navigating to the URL by typing or pasting it in the omnibox”).
In both cases, subresources with data URLs (e.g. <img src=”data:...”>, <iframe src=”data:...”>) will be allowed.
Pros of Approach 1:
Lower risk of breakage
Cons of Approach 2:
Might be confusing to some users ("why does it work when I type the address but not when I click the link?")
We might end up playing whack-a-mole with edge cases where we don't properly block the URLs
Pros of Approach 2:
Straightforward approach, consistent with IE/Edge behavior.
Might be simpler to implement.
Cons of Approach 2:
Higher risk of breakage
Compatibility Risk
IE and Edge already block all top-frame navigations to data URLs. Firefox and Safari allow them.
If we implement (2), Chrome’s behavior will align with IE/Edge after this change.
The blocking will be similar to how chrome:// URLs are handled:
For same page navigations, clicking the link won’t do anything, and a message will be displayed in the console.
For navigations in other tabs or popups, the page will navigate to about:blank instead.
No event handlers will be triggered.
Alternative implementation suggestion for web developers
The main use case for navigating to data URLs in the top frame is generating files (HTML, PDF, images etc.) on the fly and displaying them to the user.
For that use case, these alternatives exist:
- Generate the file on the backend and send it to the user over http/https.
- Initiate a download instead of displaying the URL.
- If the contents of the URL is trusted, iframe the URL so that the omnibox displays the site's URL.
Usage information
According to latest Stable Channel metrics over the last 28 days in January 2017, data URLs are 0.05% of all top-frame navigations among all platforms, and 0.01% of all navigations on Android.
OWP launch tracking bug
OWP tracking bug: https://crbug.com/684011
Discussion: https://crbug.com/594215
Entry on the feature dashboard
https://www.chromestatus.com/feature/5669602927312896
Requesting approval to remove too?
Yes, requesting approval to block top-frame navigations to data URLs.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/637edc2c-457f-4f51-9452-4e769585a615%40chromium.org.To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/da88e398-c1b5-427d-93c4-9a66ce24f79e%40chromium.org.
The newly created window then immediately closes without the developer being able to see the warning first. This is probably not ideal :)
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/55904349-84f6-497a-85ef-db23ddce64c1%40chromium.org.
javascript:/* Park Tab */ (function(){ template=` <html> <head> <title>__TITLE__</title> </head> <body> Parked Tab: <a href=__URI__>__TITLE__</a> </body> </html>`; function htmlEscape(text) { var d = document.createElement('div'); d.innerText = text; return d.innerHTML; } var newbody = ( template.replace(/__URI__/g, JSON.stringify(encodeURI(decodeURI(location.href)))).replace(/__TITLE__/g, htmlEscape(document.title))); location.href = 'data:text/html;base64,' + btoa(newbody); })();
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/98c09840-0a91-4676-90ef-e61123ef983a%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/0be5ac54-c3a1-4084-866e-5b112af5a7c9%40chromium.org.
Thank you. That is how you should think. Get rid of dangerous
functionality, but don't throw the baby out with the bath water.
You say image data URLs are safe. I would have thought so. I have
no idea how they could be harmful, and it is really extremely
frustrating to have good functionality unnecessarily destroyed.
Browser developers seem to rarely think of people like me, who try
to deliver great net art.
Please permit image data URLs in Chrome!
Are you implying that using blob URLs would generate the image faster? I haven't used blob URLs yet for anything.
ja
http://vispo.com/alephTouch/an.html
click "save" to generate a screenshot in firefox but not chrome
Thanks. I have written some code that attempts to create a screenshot of a canvas and open it in a new tab, using blobs. It creates the <img>, but when it attempts to open the <img> in a new tab, I get this message in the console: "Not allowed to load local resource". The browser itself says "Your file was not found. It may have been moved or deleted. ERR_FILE_NOT_FOUND".
Can the file be saved to disk? Can I name it? Can I open a Save As dialog box for it?
Here's the code:
var canvas=document.createElement('canvas');
canvas.toBlob(blobCreatedCallback);
function blobCreatedCallback(blob) {
var newImg = document.createElement('img');
var url = URL.createObjectURL(blob);
newImg.src = url;
newImg.onload = function() {
// no longer need to read the blob so it's revoked
URL.revokeObjectURL(url);
window.open(newImg);
};
}
☆PhistucK
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/0be5ac54-c3a1-4084-866e-5b112af5a7c9%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/c2a1c87e-090e-5d3c-02a1-a041b42aa498%40gmail.com.
Thanks. But the below doesn't work either. I'm working from the
example in
https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
titled "Getting a file representing a canvas".
var canvas=document.createElement('canvas');
canvas.toBlob(blobCreatedCallback);
function blobCreatedCallback(blob) {
var newImg = document.createElement('img');
var url = URL.createObjectURL(blob);
newImg.src = url;
newImg.onload = function() {
// no longer need to read the blob so it's revoked
window.open(url);
URL.revokeObjectURL(url);
};
}
For my use case, ie, creating a screenshot for users of a web page, the only drawback I've seen to using canvas.toBlob (thanks PhistucK) is that it's not supported on the iPad (and probably the iPhone too, though I haven't checked). My code checks if canvas.toBlob is supported and does it that way, if it can. If canvas.toBlob is not supported, I try to do it with window.open(canvas.toDataURL('image/png')).
Was there some other drawback to canvas.toBlob I missed?
Thanks,
Jim Andrews
--
You received this message because you are subscribed to a topic in the Google Groups "blink-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/blink-dev/GbVcuwg_QjM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHafXh3FuHav8uJK0JpeUs0tt2Ogh%2Bas0MDDtLO%2B2LHozdxZrw%40mail.gmail.com.
To unsubscribe from this group and all its topics, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHafXh3FuHav8uJK0JpeUs0tt2Ogh%2Bas0MDDtLO%2B2LHozdxZrw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/e2c20f01-5da9-0133-3bd7-51e8c7b6b8d0%40gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "blink-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/blink-dev/GbVcuwg_QjM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/0a00b0c4-e120-e74e-a17c-dddb95c728d5%40mit.edu.
Thanks. If I understand you correctly, then, the code for screenshots should first test for support of canvas.toBlob and do it that way if supported. Then test for being able to create a blob from a data URL. And finally, if neither of those work, try window.open(canvas.toDataURL('image/png')). Correct?
ja
How do we turn this "feature" off? Surely you have simultaneously created a flag that disables this data URL blocking behaviour to top frame for those not interested in the "feature"?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/4e1e1123-205a-450c-ab73-b14ead7feadd%40chromium.org.
Primary eng (and PM) emailshttps://www.instagram.com/accounts/edit/?hl=en
We intend to block web pages from loading data: URLs in the top frame using <A> tags, window.open, window.location and similar mechanisms.
IE and Edge already block all top-frame navigations to data URLs. Firefox and Safari allow them.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/757e2092-2599-4927-8853-c09a35847267%40chromium.org.
Hi, can you please give more details about your use case? Are you generating forms using data URLs? If so, does iframing the generated data URL not work? The sample code at https://crbug.com/594215#c64 should work with little modification.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/06c21065-67b4-43ee-bfc7-16bb7fdb08c2%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/d4542481-fc82-4939-8e9f-07718a16aaee%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAB1-osw6cfFhrdcPfLcS0WcB_oL6kRepCkTFBSxYC2uhx82V9g%40mail.gmail.com.