Skip to content

[Problem/Bug]: a problem with ICoreWebView2PermissionSettingCollectionView #5252

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

Open
jls28 opened this issue May 22, 2025 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@jls28
Copy link

jls28 commented May 22, 2025

What happened?

Seem have a problem with ICoreWebView2PermissionSettingCollectionView :

when a permission is read a second time with GetValueAtIndex :

here is my (test) code into the GetNonDefaultPermissionSettings callback :

UINT32 cnt(0);
CHECK_FAILURE(collectionView->get_Count(&cnt));	
if (cnt >= 1)
{
	wil::com_ptr<ICoreWebView2PermissionSetting> perm;
	CHECK_FAILURE(collectionView->GetValueAtIndex(0, &perm));
	
	wil::unique_cotaskmem_string org;
	CHECK_FAILURE(perm->get_PermissionOrigin(&org));	//ok, org is L"https://..."

	// read the permission another time cause problems :
	wil::com_ptr<ICoreWebView2PermissionSetting> perm2;
	CHECK_FAILURE(collectionView->GetValueAtIndex(0, &perm2));	// no error reported

	wil::unique_cotaskmem_string org2;
	CHECK_FAILURE(perm2->get_PermissionOrigin(&org2));	// <-- no error reported BUT org2 is L"" (empty string) now

	//also here perm2-get_PermissionKind		report no error but kind is wrong : 0 (unknown)
}

Is my code wrong ?

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

135.0.3179.98

SDK Version

1.0.2739.15

Framework

Win32

Operating System

Windows 10

OS Version

No response

Repro steps

try the code

Repros 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

@jls28 jls28 added the bug Something isn't working label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants