-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility problem for legacy-JS that access COM-API with "Name"-property as ".name" #641
Comments
I've added this bug to our backlog - thanks for the report! |
Currently we work around this issue by applying carefully crafted regex to scripts when loaded. The workaround applied conditionally after detection to determine if Object name === Object.Name |
Hi @pontusn, I'm a dev looking into this issue. Could you please explain what are your expectations for host object |
COM APIs are case-insensitive, all case-variations for properties and method should yield same result. In current WebView2 any local JS members take priority over proxied COM API, hence the built in "name" property overides "name", while all other variations are correctly mapped to underlying COM API "Name" via automation. |
My recommendation in this case would be to avoid the implicit "name" property by using an anonymous object. If the "name" property is required for operation I would suggest using something with less risk for conflicts, any guid prefixed with a few underscore should be zero risk... |
This should be fixed in runtimes 96.0.1042.0+. Thanks! |
Our host has a COM-API where almost every entity expose a "Name"-property. Common usage i legacy-JS hosted in IE/WebBrowser use ".name" to access the value.
For WebView2 this results in "CallableTarget" instead of actual value, ie.
obj.Name !=== obj.name
.Problem originates from:
Maybe this is an alternative to avoid an implicit name-property from Function-object?
Version
SDK: GA
Runtime: GA
Framework: Win32
OS: Win10 x64
AB#30786383
The text was updated successfully, but these errors were encountered: