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

fix hg-pages script src #80

Closed
wants to merge 1 commit into from

Conversation

ywzhaiqi
Copy link

@ywzhaiqi ywzhaiqi commented Jul 19, 2017

hg-pages can't work. Error with

Refused to execute script from 'https://github.com/sizzlemctwizzle/GM_config/raw/master/gm_config.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

Refused to execute script from 'https://github.com/sizzlemctwizzle/UserScripts/raw/master/gm_config_unit_test.user.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled

Copy link
Collaborator

@Martii Martii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MITM detected

@@ -1,8 +1,8 @@
<html>
<head>
<script src="https://github.com/sizzlemctwizzle/GM_config/raw/master/gm_config.js" type="text/javascript"></script>
<script src="https://rawgit.com/sizzlemctwizzle/GM_config/master/gm_config.js" type="text/javascript"></script>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing a redirect to https://raw.githubusercontent.com/sizzlemctwizzle/GM_config/master/gm_config.js from the original and not to https://rawgit.com/sizzlemctwizzle/GM_config/master/gm_config.js which belongs to Google.

-1 for this using a MITM to serve it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raw.githubcontent.com with the same Error.

Refused to execute script from 'https://raw.githubusercontent.com/sizzlemctwizzle/GM_config/master/gm_config.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

rawgit.com come from https://stackoverflow.com/questions/17341122/link-and-execute-external-javascript-file-hosted-on-github

Example:

http://raw.githubusercontent.com/user/repo/branch/file.js

Use this URL for development:

http://rawgit.com/user/repo/branch/file.js
Use this URL in production:

http://cdn.rawgit.com/user/repo/tag/file.js

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sizzlemctwizzle

Probably the most relevant item is from https://github.com/blog/1482 ... confirmed on headers. Interesting how it's been four years since they've added this and it's just now showing up in some browsers.

Still at -1 for using a MITM to handle this but it's up to you. Google (the one that owns that domain) can track usage without user consent this way as well as they could serve whatever they want which seems quite a bit shady imho.

@ywzhaiqi

raw.githubcontent.com with the same Error.

I presume you meant raw.githubusercontent.com.

Copy link
Collaborator

@Martii Martii Jul 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sizzlemctwizzle
I suppose it could go back to OUJS library source since caching both clients and server side has been signaled properly with blocking when no caching is enabled... but I have no easy way of syncing this repo with OUJS whenever there is a change. *shrugs*

Ref:

</head>
<body>
<script src="https://github.com/sizzlemctwizzle/UserScripts/raw/master/gm_config_unit_test.user.js" type="text/javascript"></script>
<script src="https://rawgit.com/sizzlemctwizzle/UserScripts/master/gm_config_unit_test.user.js" type="text/javascript"></script>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 for this using a MITM to serve it here as well.

@Martii Martii added Cause Identified root cause has been identified Rejected proposed change is rejected labels Jul 21, 2017
Martii pushed a commit to Martii/GM_config that referenced this pull request Jul 21, 2017
* Some browsers are starting to implement https://github.com/blog/1482 and thus preventing web demo from running. *express-brute* can still prevent the demo from running however with some more recent caching changes on OUJS it should be less problematic.
* Put in some basic boiler plate HTML.
* Change to strict MIME content type... this may prevent older browsers from executing it but it's the default registered type.
* Remove script from GH page branch repo ... may be able to copy repo sources here if need be and exec here if there are issues but keeping editability references for now.

NOTES:
* Thanks to @ywzhaiqi for the notification in sizzlemctwizzle#80

Applies to sizzlemctwizzle#64 and closes sizzlemctwizzle#80
@Martii Martii closed this in f6b7bf5 Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cause Identified root cause has been identified Rejected proposed change is rejected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants