WebFundamentals
WebFundamentals copied to clipboard
Anchor's href must be Same-Origin for download Attribute to Work
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 thedevelopers.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).