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