Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub raw file is MIME type text/plain and will not execute in new browsers #5

Closed
akaleeroy opened this issue Jun 4, 2014 · 6 comments

Comments

@akaleeroy
Copy link

Chrome 35.0.1916.114 m
Console error: Refused to execute script from 'http://github.com/zaius/youtube_playlist/raw/master/youtube_playlist.min.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

Found details about this problem at Link and execute external JavaScript file hosted on GitHub - Stack Overflow

Whoops sorry, 2 years old.

@zaius zaius closed this as completed in cf9f994 Jun 4, 2014
@zaius
Copy link
Owner

zaius commented Jun 4, 2014

Hrm nope using the raw url didn't fix it. I'll dig a bit more. Thank for the bug report!

@zaius zaius reopened this Jun 4, 2014
@zaius
Copy link
Owner

zaius commented Jun 4, 2014

OK should be working now - didn't realize that rawgit was a separate thing to github's raw server.

@zaius zaius closed this as completed Jun 4, 2014
@akaleeroy
Copy link
Author

Sorry I forgot to get back here and post.

EDIT: I fixed it. Looked at Link and execute external JavaScript file hosted on GitHub - Stack Overflow and modified the bookmarklet accordingly:

javascript: (function() {
    var a = document.createElement("script");
    a.src = "//rawgithub.com/zaius/youtube_playlist/master/youtube_playlist.min.js";
    document.getElementsByTagName("head")[0].appendChild(a)
})();

This worked for me. Awesome work BTW!

@zaius
Copy link
Owner

zaius commented Jun 4, 2014

Thanks! Glad to see it's still getting some use!

tesYolan added a commit to tesYolan/rostogapi_final that referenced this issue Jul 22, 2015
@yairEO
Copy link

yairEO commented Jul 5, 2018

@akaleeroy - you surely mean document.head and not document.getElementsByTagName("head")[0]

@akaleeroy
Copy link
Author

@yairEO Yeah I guess that's an unnecessary precaution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants