WebFundamentals icon indicating copy to clipboard operation
WebFundamentals copied to clipboard

Anchor's href must be Same-Origin for download Attribute to Work

Open dhurlburtusa opened this issue 3 years ago • 0 comments

At https://developers.google.com/web/updates/2011/08/Downloading-resources-in-HTML5-a-download, I tried clicking on the "download me" link but it behaved the same as a link without a download attribute--it displays the PNG file in a browser tab.

I took a look at https://caniuse.com/download and looked at the "Known Issues" tab. It says it requires the same-origin for it to work since Chrome 65.

Page Affected: https://developers.google.com/web/updates/2011/08/Downloading-resources-in-HTML5-a-download

What needs to be done?

  • Making the href to use the developers.google.com origin would be good.
  • Update article to let reader know that a same-origin is required (or may be required depending on the browser).

dhurlburtusa avatar Sep 26 '21 18:09 dhurlburtusa