Skip to content
This repository was archived by the owner on Jun 22, 2025. It is now read-only.

Commit 65c1423

Browse files
Set JS mimetype (#289)
#49 #181 it seems like these issues weren't ever truly fixed. It would be nice if Eel set the mimetypes on its own. According to pallets/flask#1045 this bug will happen for all Windows users. The most common use for this would be to import JS modules. Chrome doesn't allow modules with incorrect mimetypes to be loaded without a registry edit. mimetypes is a Python standard lib so there shouldn't be much impact. Cheers!
1 parent 7041a07 commit 65c1423

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

eel/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
import sys
1414
import pkg_resources as pkg
1515
import socket
16+
import mimetypes
1617

18+
mimetypes.add_type('application/javascript', '.js')
1719
_eel_js_file = pkg.resource_filename('eel', 'eel.js')
1820
_eel_js = open(_eel_js_file, encoding='utf-8').read()
1921
_websockets = []

0 commit comments

Comments
 (0)