Closed JamesNewton closed 5 years ago
I have now deployed this repository to GitHub pages. The URL https://scratchx.org/?url=https://kenny2github.github.io/scratch-dexter/ext.js#scratch (on Chrome, click to enable Flash) successfully loads the extension.
I've updated my docs to use your link.
It would be nice to go to http://scratchx.org click "more blocks" then "Load experimental extension" and be able to load the extension from this URL: https://raw.githubusercontent.com/Kenny2github/scratch-dexter/master/ext.js or to do that in one step with http://scratchx.org?url=https://raw.githubusercontent.com/Kenny2github/scratch-dexter/master/ext.js but when you try that, nothing happens. If you start the Chrome debug tools (menu, more tools, developer tools) you see an error message:
Refused to execute script from 'https://raw.githubusercontent.com/Kenny2github/scratch-dexter/master/ext.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
See also:
https://stackoverflow.com/questions/17341122/link-and-execute-external-javascript-file-hosted-on-github/18049842 For development, we may be able to turn off the script mime type checking by starting Chrome with:
chrome.exe --user-data-dir="C://Chrome dev session" --disable-web-security
RawGit.com is no longer an option
https://pages.github.com/ is a hosting service, but the repo name must be your github user name followed by ".github.io" which is the url where the site can be accessed. e.g. https://github.com/JamesNewton/JamesNewton.github.io is accessable at https://jamesnewton.github.io/ .js files loaded into that repo can be loaded in scratchx as desired, but then you can't have the extension in it's own repo. This appears to be the workaround used by the extensions which work on scratchx. The current version of the extension was copied to my github page and the following link appears to work https://scratchx.org/?url=https://jamesnewton.github.io/scratch/ext.js
https://github.com/LLK/scratchx/wiki#load-a-javascript-file-hosted-on-github It is apparently possible to make a special branch on any of your repos and set it to be served via github pages. This is complex, but would make life simple for users.
Suggestion: Follow the directions in the link above to make it very easy for users to load scratchx with the url to the extension and talk to their dexter.