Closed GameMaster719 closed 5 years ago
Hey, I've got the same problem trying to download ipynb file. Have you found any solution? I also can download a file via an icon of one.
I had checked the chrome console and it error log message maybe show some clue:
Refused to load the image 'data:image/png;base64,xxxxxx' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
Same problem for me too. The download option just downloads the raw file.Any solutions?
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 ☹
Hit the download button on a file, and its the exact same result as hitting the raw button and getting a web view of the file, and don't download anything..