You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per the docs, I am using evaluate_js. Nevertheless, I wonder if there should be (or maybe there is and I don't know about it), a way to just call js functions that are exposed to an object from python directly, the same way that we can call and expose an API class from python to JS. This could make it much more "coherent", and if we needed to pass objects like arrays or dicts, from Python to JS, it could be done in a much cleaner way.
Right now, If we want to pass an array to JS, unless I am missing something, we have to do something like dump the data to a dict to have it in the raw code, but I find it ugly. I know how to write my own code, in order to abstract it and create a pseudo_api, like the exposed API python for the JS side.
But I wonder if it shouldn't be best, for pywebview, to have the option to pass a JS class, with functions to the python side, and have the python side be able to call them, in order to avoid the raw strings "madness" for general domain intercomunication.
Practicalities
YES, I am willing to work on this issue myself.
The text was updated successfully, but these errors were encountered:
I like this idea, but to be honest I do not see a clear way how this should be handled. Do you have suggestions how this should be implemented on the API level? Both in Python and Javascript?
In theory it would be great to auto-update variables as well, but I am afraid this is not something that could be done in Python
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Specification
pywebview version: pywebview==3.6.3
operating system: win10
web renderer: edgeView2
Description
Per the docs, I am using evaluate_js. Nevertheless, I wonder if there should be (or maybe there is and I don't know about it), a way to just call js functions that are exposed to an object from python directly, the same way that we can call and expose an API class from python to JS. This could make it much more "coherent", and if we needed to pass objects like arrays or dicts, from Python to JS, it could be done in a much cleaner way.
Right now, If we want to pass an array to JS, unless I am missing something, we have to do something like dump the data to a dict to have it in the raw code, but I find it ugly. I know how to write my own code, in order to abstract it and create a pseudo_api, like the exposed API python for the JS side.
'''
send_data({"pepe": 4, "lol": [3, 3, 4, 5, 5]})
'''
But I wonder if it shouldn't be best, for pywebview, to have the option to pass a JS class, with functions to the python side, and have the python side be able to call them, in order to avoid the raw strings "madness" for general domain intercomunication.
Practicalities
The text was updated successfully, but these errors were encountered: