WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

[Problem/Bug]: ClearBrowsingDataAsync doesn't clear service worker logs

Open ibebbs opened this issue 1 year ago • 2 comments

What happened?

Further to #3341, using ClearBrowsingDataAsync leaves service worker log files intact which contain the plain text domains of visited sites.

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

124.0.2478.97

SDK Version

1.0.2478.35 + 1.0.2562-prerelease

Framework

WPF

Operating System

Windows 10, Windows 11

OS Version

22631.3593

Repro steps

  1. Clone, build and run the WebView2WpfBrowser sample app
  2. Visit https://privacy-test-pages.site/privacy-protections/storage-blocking/?store#947 to store some data in a service worker
  3. Use the "Scenario" -> "Clear Browsing Data" -> "All Profile" (or any/all the other options) to clear browsing data
  4. Use SysInternals Strings to scan the content of bin\[Debug Experimental APIs|Debug Stable APIs]\netcoreapp3.0\WebView2WpfBrowser.exe.WebView2\EBWebView\Default\Service Worker\Database for strings (e.g. strings64.exe -nobanner "bin\Debug Stable APIs\netcoreapp3.0\WebView2WpfBrowser.exe.WebView2\EBWebView\Default\Service Worker\Database\*.*")
    • The privacy-test-pages.site site will appear several times in the output; e.g. 7INITDATA_UNIQUE_ORIGIN:https://privacy-test-pages.site/

Repros in Edge Browser

Yes, issue can be reproduced in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

AB#51682189

ibebbs avatar May 16 '24 13:05 ibebbs

@victorhuangwq , @monica-ch , @sivMSFT , @Lakshmisha-KS This issue also exists when I am trying to clear the browsing history , but still the history is not clearing EBWebView\Default\History I am using this code ,

if (WebView.CoreWebView2 != null)
{
    CoreWebView2Profile? profile = WebView?.CoreWebView2?.Profile;
    CoreWebView2BrowsingDataKinds dataKinds = CoreWebView2BrowsingDataKinds.BrowsingHistory;
    if (profile != null)
    {
        await profile.ClearBrowsingDataAsync(dataKinds);
    }
}

So want to ask , can I use FileSystem to clear the content inside History file ? Want to know the drawback of this approach , what problem can be created .

rahullli avatar Mar 20 '25 14:03 rahullli

@victorhuangwq , @monica-ch , @sivMSFT , @Lakshmisha-KS This issue also exists when I am trying to clear the browsing history , but still the history is not clearing EBWebView\Default\History I am using this code ,

if (WebView.CoreWebView2 != null)
{
    CoreWebView2Profile? profile = WebView?.CoreWebView2?.Profile;
    CoreWebView2BrowsingDataKinds dataKinds = CoreWebView2BrowsingDataKinds.BrowsingHistory;
    if (profile != null)
    {
        await profile.ClearBrowsingDataAsync(dataKinds);
    }
}

So want to ask , can I use FileSystem to clear the content inside History file ? Want to know the drawback of this approach , what problem can be created .

URGENT Hi @chetanpandey1266 , @sivMSFT , @victorhuangwq , @champnic , @monica-ch We need a quick resolution on this bug , so want to know your POV on this comment .

rahullli avatar Apr 08 '25 08:04 rahullli