ultralight-ux / AppCore

Cross-platform app runtime module for Ultralight
https://ultralig.ht
GNU Lesser General Public License v2.1
82 stars 24 forks source link

MIME type of .js file on Windows is text/plain (sometimes?) #13

Open p0358 opened 1 year ago

p0358 commented 1 year ago
[GetFileMimeType] Bin/launcher-ui/js/app.js = text/plain
[GetFileMimeType] Bin/launcher-ui/css/main.css = text/css
[Ultralight] [Console]: [JS] [Error] TypeError: 'text/plain' is not a valid JavaScript MIME type. (@1:11)

I see the default platform filesystem implementation on Windows uses registry to check for MIME type. However... image

Turns out on some systems it's actually set to text/plain for .js files in the registry! I'd propose adding some hardcoded mapping for the most common web extensions, especially that WebCore will refuse to load a .js file with wrong MIME type, apparently, unlike Firefox and Chromium. I guess either that or make a patch to ignore wrong MIME type for JS files?