How to get values from frontend script #466
SergeyPriem
started this conversation in
General
Replies: 1 comment 1 reply
-
Hi Sergey, the architecture, due to security concerns, only allows communication from client to server via events. You can generate an event and catch it on the other side. I tested this and it works as expected. Then the event export function sendCustomEvent() {
alert("Sending");
const ev = new CustomEvent("myinfo", {
detail: {
payload: window.screen.height,
callback: () => {
alert("Custom event sent successfully.");
},
},
});
globalThis.core.forwardEvent(ev, [{componentId: "root", instanceNumber: 0}], true);
} What's the use case by the way? We may look into implementing a more straightforward way of doing this. |
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 want to get the screen size from the Javascript function and use it in Python functions.
The function state.call_frontend_function returns None.
How to get values from the frontend module?
Beta Was this translation helpful? Give feedback.
All reactions