Page 1 of 1

incognito

Posted: Fri Jun 24, 2022 11:47 am
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.

Re: incognito

Posted: Sun Jun 26, 2022 7:24 am
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';

Re: incognito

Posted: Wed Jul 06, 2022 9:45 pm
by pushca
If the browser follows these rules, will it delete the directories created by itself?

Re: incognito

Posted: Sat Jul 09, 2022 8:54 am
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.