Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

incognito

Post Reply
pushca
Posts: 37
Joined: Sat Dec 04, 2021 5:09 pm

incognito

Post by pushca »

Hello. Reading the documentation in Firefox in incognito mode, I found that in this mode the browser stores data in RAM without affecting the disk. I would really like one of your projects to have such an opportunity.
User avatar
salvadordf
Posts: 4563
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: incognito

Post by salvadordf »

WebView2 always uses some directory on the disk for the user data, even when you leave GlobalWebView2Loader.UserDataFolder empty.

You could set GlobalWebView2Loader.UserDataFolder to a directory on a RAM disk drive :
https://beebom.com/create-ram-disk-windows-10-super-fast-read-write-speeds/
https://answers.microsoft.com/en-us/windows/forum/all/create-a-ram-disk-drive-in-windows-7-and-windows/cd42aac4-8b0e-4b61-a2ea-9560a3e17d5b

The incognito mode in WebView2 can be enabled by setting these properties before the TWVBrowserBase.CreateBrowser call :
  • TWVBrowserBase.IsInPrivateModeEnabled := True;
  • TWVBrowserBase.ProfileName := 'MyIncognitoProfileName';
pushca
Posts: 37
Joined: Sat Dec 04, 2021 5:09 pm

Re: incognito

Post by pushca »

If the browser follows these rules, will it delete the directories created by itself?
User avatar
salvadordf
Posts: 4563
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: incognito

Post by salvadordf »

No but you can use this to delete all the cache, cookies, local storage data, etc :

Code: Select all

TWVBrowserBase.ClearDataForOrigin('*');
The RAM drive contents don't remain on the computer after rebooting.
Post Reply