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
When using a host object, I was trying to check whether a function exists before calling it, according to ignoreMemberNotFoundError, I shall be able to use this option to prevent exception.
However, this option doesn't work in my end.
Here is the test case I was using.
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
123.0.2420.97
SDK Version
1.0.2420.47
Framework
WPF
Operating System
Windows 10
OS Version
10.0.19045
Repro steps
Create a C# host class
Register the host object with CoreWebView2.AddHostObjectToScript
Follow winrt-from-js sample, hook up JS with AddScriptToExecuteOnDocumentCreatedAsync()
Start application, inspect state in debug console, see screenshot: getIsEntitled() is a valid function from host C# object, fakeMethod doesn't exist at all, however, since ignoreMemberNotFoundError was set to true, I am expecting accessing fakeMethod should return an undefined instead of throwing an exception
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
It seems that WebView2 implementation only covers DISP_E_MEMBERNOTFOUND and missed handling of DISP_E_UNKNOWNNAME. Created internal work item to track the issue.
What happened?
When using a host object, I was trying to check whether a function exists before calling it, according to ignoreMemberNotFoundError, I shall be able to use this option to prevent exception.
However, this option doesn't work in my end.
Here is the test case I was using.
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
123.0.2420.97
SDK Version
1.0.2420.47
Framework
WPF
Operating System
Windows 10
OS Version
10.0.19045
Repro steps
CoreWebView2.AddHostObjectToScript
AddScriptToExecuteOnDocumentCreatedAsync()
getIsEntitled()
is a valid function from host C# object,fakeMethod
doesn't exist at all, however, sinceignoreMemberNotFoundError
was set totrue
, I am expecting accessingfakeMethod
should return anundefined
instead of throwing an exceptionRepros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
AB#50274346
The text was updated successfully, but these errors were encountered: