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
I tend to trigger the postMessage with the following codes on HTML.
But those JavaScriptMessageHandlers on Dart can not been triggered.
While this problems only occurs on Windows, but not macOS.
Found this PR #168, and I upgrade this package to to desktop_webview_window: ^0.2.0, and the code downloaded do includes the added code from this PR, but this still can not work.
[Update1: ] It seems caused by the following if, that prevent the platfrom aprt from macOS to register the handler. Can I just remove this judgment logic?
[Update2: ] Solution found: In this case, postMessage should be called as window.chrome.webview.postMessage(val); , and add a addOnWebMessageReceivedCallback listener on Dart layer. This issue can be cloused.
The text was updated successfully, but these errors were encountered:
RoleWong
changed the title
JavaScriptMessageHandler can not been trigered on Flutter 3.7.7 with Windows 10, built to Windows Platform
JavaScriptMessageHandler can not been trigered on Windows Platform
Mar 16, 2023
** Solution found: In this case, postMessage should be called as window.chrome.webview.postMessage(val); , and add a addOnWebMessageReceivedCallback listener on Dart layer. This issue can be cloused.**
I tend to trigger the postMessage with the following codes on HTML.
But those JavaScriptMessageHandlers on Dart can not been triggered.
While this problems only occurs on Windows, but not macOS.
Found this PR #168, and I upgrade this package to to desktop_webview_window: ^0.2.0, and the code downloaded do includes the added code from this PR, but this still can not work.
[Update1: ] It seems caused by the following
if
, that prevent the platfrom aprt from macOS to register the handler. Can I just remove this judgment logic?[Update2: ] Solution found: In this case, postMessage should be called as
window.chrome.webview.postMessage(val);
, and add aaddOnWebMessageReceivedCallback
listener on Dart layer. This issue can be cloused.The text was updated successfully, but these errors were encountered: