Drag & drop file into webview #3372
EmberLightVFX
started this conversation in
Ideas / Feature Requests
Replies: 1 comment 1 reply
-
Hello @EmberLightVFX. That sounds interesting. The communication between pywebview and NiceGUI is tricky because they must run in separate processes. We use Lines 15 to 16 in 874b5ab But firing an event from JavaScript may be a smart work around. @polaar had some experiment going in this regard: #283 (reply in thread). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I really need to be able to drag and drop files and folders into the webview and get the objects full path.
It's impossible to get the objects path using javascript. It's a safety mechanism.
But it is possible to get the path using pywebview's dom https://pywebview.flowrl.com/examples/drag_drop.html !
I have tried adding the above code into
native_module.py
and it works as wanted!The problem now is how to make the pywebview instance and NiceGUI communicate with each other.
app.native.main_window.dom always returns None for me...
The best would be if there is some way to fire events to get the data, like
ui.on("drop", my_func)
.Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions