MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Reading Host Object Properties with parameters

Open
#1,454 3 comments 0 reactions 1 assignee View on GitHub

@champnic is already working on this.

Since Jun 30, 2021.

bug priority-low tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Description
I have added a host object like this:

Public Class TestHost
	Public ReadOnly Property A(ByVal Name As String) As string
		Get
			Return "A"
		End Get
	End Property

	Default Public ReadOnly Property B(ByVal Name As String) As String
		Get
			Return "B"
		End Get
	End Property

	Public ReadOnly Property C
		Get
			Return "C"
		End Get
	End Property
End Class

The properties B and C are readable from scripting.
Reading property A throws an error:

Error: Falscher Parameter. (0x80070057)
    at RemoteMessenger.postSyncRequestMessage (<anonymous>:1:10501)
    at Function.getHostProperty (<anonymous>:1:22938)
    at Function._getAmbiguous (<anonymous>:1:13924)
    at Object.get (<anonymous>:1:15502)
    at WebView.js:14

Version
SDK: 1.0.864.35
Runtime: 91.0.864.54
Framework: WinForms
OS: Win10

Repro Steps
Add the the above host object.
Read A from scripting

console.log(window.chrome.webview.hostObjects.sync.TestHost.A("Z"))

I expect it to output the property value, but it throws the error.

Additional context
It looks like B is working because it is the "Default" property.

AB#34123921

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.