TranscryptOrg / Transcrypt

Python 3.9 to JavaScript compiler - Lean, fast, open!
https://www.transcrypt.org
Apache License 2.0
2.82k stars 215 forks source link

Feature request regarding COR/local use of Transcrypt files in combination with pywebview #824

Open baschni opened 2 years ago

baschni commented 2 years ago

Hello,

if I am correct you cannot use Transcrypt generated JS files embedded in a local html file by directly opening this file in a local browser as javascript modules are only allowed to be embedded through http/https?

I would like to use Transcrypt locally in combination with pywebview to create user interfaces to python programs just with HTML and javascript. Pywebview opens a browsing window and allows communication with a python script to the java script in this browsing window.

As I like this approach and I see no need to start a server on the local machine with pywebview, is it possible to tell transcrypt just to put out non modularized java script code? Would that be a new feature? Or would I have to replace all the "export"-statements in the Javascript file manually and would it still work then?

Kind regards Bastian