web renderer: [pywebview] Using WinForms / Chromium
Test Code:
import webview
html = """
<head>
<script>
function click_me() {
// alert("hello") // this won't cause an error
alert({hello:"world"}) // err
// alert(114514.1919) // err
// alert([1,2,3,4,5]) // err
};
</script>
</head>
<body>
<button style="width: 150px; height: 50px;", onclick="click_me()">Click me</button>
</body>
"""
window = webview.create_window('Window', html=html)
webview.start(debug=True)
Behavior:
Click the button, the messagebox is not out, an error occered.
Error message:
[pywebview] Exception occurred during on_script_notify
Python.Runtime.PythonException: 'dict' value cannot be converted to System.String
The above exception was the direct cause of the following exception:
System.ArgumentException: 'dict' value cannot be converted to System.String in method System.Windows.Forms.DialogResult Show(System.String) ---> Python.Runtime.PythonException: 'dict' value cannot be converted to System.String
--- 内部异常堆栈跟踪的结尾 ---
The above exception was the direct cause of the following exception:
System.AggregateException: 发生一个或多个错误。 ---> System.ArgumentException: 'dict' value cannot be converted to System.String in method System.Windows.Forms.DialogResult Show(System.String) ---> Python.Runtime.PythonException: 'dict' value cannot be converted to System.String
--- 内部异常堆栈跟踪的结尾 ---
--- 内部异常堆栈跟踪的结尾 ---
---> (内部异常 #0) System.ArgumentException: 'dict' value cannot be converted to System.String in method System.Windows.Forms.DialogResult Show(System.String) ---> Python.Runtime.PythonException: 'dict' value cannot be converted to System.String
--- 内部异常堆栈跟踪的结尾 ---<---
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\yunline\AppData\Local\Programs\Python\Python311\Lib\site-packages\webview\platforms\edgechromium.py", line 194, in on_script_notify
WinForms.MessageBox.Show(func_param)
TypeError: No method matches given arguments for MessageBox.Show: (<class 'dict'>)
Specification
[pywebview] Using WinForms / Chromium
Test Code:
Behavior:
Click the button, the messagebox is not out, an error occered. Error message: