PAY ATTENTION!
You can't include Github scripts directly from Github after this change.
We added the
X-Content-Type-Options: nosniff
header to our raw URL responses way back in 2011 as a first step in combating hotlinking. This has the effect of forcing the browser to treat content in accordance with theContent-Type
header. That means that when we setContent-Type: text/plain
for raw views of files, the browser will refuse to treat that file as JavaScript or CSS.
But there are alternatives. Check my answer to this question.
I am trying to include a JavaScript file from GitHub into a local HTML file for testing (like an image found on the internet: <img src=http://...>
).
I would like something like this:
<script src=https://github.com/[username]/[repository]/blob/master/public/[fileName].js></script>
The problem is that this doesn't work.
How can I do this?