When I try to change the linked reference of a local JavaScript file to a GitHub raw version my test file stops working. The error is:
Refused to exe
Above answers clearly answer the question but I want to provide another alternative - A different view/approach to solve the similar problem.
You can also use browser extension to remove X-Content-Type-Options
response header for raw.githubusercontent.com
files. There are couple of browser extensions to modify response headers.
If you use Requestly, I can suggest two solutions
Remove
-> Response
-> X-Content-Type-Options
Url
-> Contains
-> raw.githubusercontent.com
raw.githubusercontent.com
with rawgit.com
Check this screenshot for more details
We created a simple JS Fiddle to test out if we can use raw github files as scripts in our code. Here is the Fiddle with the following code
If you see Script evaluated successfully!
, It means you are able to use raw github file in your code
Otherwise Problem evaluating script
indicates that there is some problem while executing script from raw github source.
I also wrote an article on Requestly blog about this. Please refer it for more details.
Hope it helps!!
Disclaimer: I am author of Requestly So you can blame for anything you don't like.