Closed charles9056 closed 5 years ago
The Download button is visible when viewing a single file, ex: https://github.com/camsong/chrome-github-mate/blob/master/README.md
But when the Download button is clicked, then it works the same way as the default Raw button, which opens the file as text: https://raw.githubusercontent.com/camsong/chrome-github-mate/master/README.md
The file doesn't start downloading as one would expect.
P.S. Just noticed that the Download/Raw button issue already had been reported here: Download button just puts raw view exact same as hitting raw button. #41
This is because the <a>
download
attribute does not support cross origin download, according to:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes
This attribute only works for same-origin URLs.
When you clock 'download' button, GitHub will redirect you to https://raw.githubusercontent.com/xxx
, will violate the same-origin policy.
Right now, this is no work around ☹
same with https://github.com/camsong/chrome-github-mate/issues/41
the button 'click to download' is disappeared.