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

Need a way to edit permissible MIME types #133

Closed
AskYous opened this issue Mar 6, 2018 · 5 comments
Closed

Need a way to edit permissible MIME types #133

AskYous opened this issue Mar 6, 2018 · 5 comments

Comments

@AskYous
Copy link

AskYous commented Mar 6, 2018

I'm trying to serve an mjs file but the browser rejects using it. It says:

Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.

@kzahel
Copy link
Owner

kzahel commented Mar 7, 2018

Would a process like this work for you...

- open chrome://inspect, inspect web server background page
- type WSC.addMimeType('mjs','application/javascript')

you would have to do this each time you install web server on a new computer.

(don't try this, I didn't code it yet)

@AskYous
Copy link
Author

AskYous commented Mar 7, 2018

Yes, that would be fine. But ideally, it would be somewhere in the advanced settings:
image

That would make it easy and I can see the MIME types I added in case I forget they're there in the future. Appreciate your work!

@Sti2nd
Copy link

Sti2nd commented Oct 8, 2018

Just bumped into this issue.

The server could just support JavaScript modules by returning the correct MIME-type? Modules are coming, and they require correct MIME type https://developers.google.com/web/fundamentals/primers/modules

I would propose to change this issue to "Support JavaScript modules" since that was the original problem

@aiden-w-135752345
Copy link

aiden-w-135752345 commented Jan 11, 2020

I guess something similar also needs to happen for .wasm to application/wasm.
WSC.addMimeType('wasm','application/wasm')
will this stay fixed after my Chromebook restarts?

edit: WSC.addMimeType does not exist, do WSC.MIMETYPES.wasm="application/wasm"

@kzahel
Copy link
Owner

kzahel commented Jan 11, 2020

This will be included by default in the next release:

cb300b1 (Chris Chou 2019-02-25 20:32:53 +1300 875) "wasm": "application/wasm",
0329c4e (Ahmet Kizilay 2018-11-11 17:32:53 -0500 442) "mjs": "application/javascript",

@kzahel kzahel closed this as completed Jan 11, 2020
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

4 participants