incognito mode with Chrome runtime

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

incognito mode with Chrome runtime

Postby naoki5 » Tue Jul 30, 2024 9:29 pm

My application implements “incognito mode” by setting CefSettings.cache_path to empty.
This behavior is described in cef_types.h.

https://github.com/chromiumembedded/cef/issues/3685
I have migrated my application to Chrome bootstrap + Alloy style.
Then, even if cache_path is empty, the cache data is still stored.
It appears to be stored in the following location.

C:\Users\username\AppData\Local\CEF\User Data\Default

cefclient works the same way.
Disabling Chrome runtime makes it work in incognito mode.

cefclient.exe --disable-chrome-runtime

Is this behavior a Chrome runtime specification?
How can I implement incognito mode with Chrome bootstrap?


CEF 127.0.20 Windows 32-bit
Windows 11 Pro 23H2 (Japanese)
Visual Studio 2022 Version 17.10.5
Win SDK 10.0.22621.3233
naoki5
Expert
 
Posts: 124
Joined: Wed Jul 17, 2019 2:44 am

Re: incognito mode with Chrome runtime

Postby magreenblatt » Wed Jul 31, 2024 9:18 am

Cache data will still be stored, however profile data will not. See the documentation.
magreenblatt
Site Admin
 
Posts: 12947
Joined: Fri May 29, 2009 6:57 pm

Re: incognito mode with Chrome runtime

Postby naoki5 » Wed Jul 31, 2024 7:48 pm

I did not understand the documentation correctly.
With Chrome runtime, does this mean that data is always stored on disk?
Does this mean that it is no longer possible to set it to incognito mode?
naoki5
Expert
 
Posts: 124
Joined: Wed Jul 17, 2019 2:44 am

Re: incognito mode with Chrome runtime

Postby magreenblatt » Wed Jul 31, 2024 8:39 pm

There is a difference between cache and profile data. “Incognito mode” means that profile data is not stored on disk. See https://chromium.googlesource.com/chrom ... ata_dir.md
magreenblatt
Site Admin
 
Posts: 12947
Joined: Fri May 29, 2009 6:57 pm

Re: incognito mode with Chrome runtime

Postby naoki5 » Wed Jul 31, 2024 9:57 pm

I think I understand most of it.
Thanks.

I was hoping that cache, history, cookies, etc. would not be stored and it worked that way with Alloy runtime.
With Chrome runtime it is stored in “Default” and I need to remove it.
naoki5
Expert
 
Posts: 124
Joined: Wed Jul 17, 2019 2:44 am

Re: incognito mode with Chrome runtime

Postby TaurusPrime » Fri Jan 17, 2025 5:51 pm

Hi,

I don't understand the solution.

So, we have:

Code: Select all
// Specify CEF global settings here.
CefSettings settings;
CefString(&settings.root_cache_path).FromWString(root_cache_path);
CefString(&settings.cache_path).FromWString(L"");


and in OnBeforeCommandLineProcessing:

Code: Select all
command_line->AppendSwitch("incognito");


But still there are a lot of files in "C:\Users\username\AppData\Local\CEF\User Data\Default".

Most scary is History in "Default". URLs can be seen in clear text.

So please, how to use the chrome-built-in incognito with CEF for a save browser experience?

Btw: looks like a bug. V126 with use_views is working. V132 is not working.
Win 10 x64, Latest CMake + Visual Studio 2022 C++, modding cefsimple, using latest cef x64 Release
TaurusPrime
Techie
 
Posts: 32
Joined: Mon Jul 11, 2022 8:00 am

Re: incognito mode with Chrome runtime

Postby Rister » Tue Feb 11, 2025 8:18 am

TaurusPrime wrote:Hi,
Btw: looks like a bug. V126 with use_views is working. V132 is not working.

Probably the issue at github is also yours according to the username

I noticed this in cef 131 (0.6778.265). Maybe if we can bisect this into some concrete version after V126 but before V131 range, the developers will be able to fix it quickly.
Rister
Newbie
 
Posts: 7
Joined: Thu Nov 17, 2022 6:55 am

Re: incognito mode with Chrome runtime

Postby magreenblatt » Tue Feb 11, 2025 10:49 am

The "Default" profile is always created by default but will only be used for non-incognito browsers.
magreenblatt
Site Admin
 
Posts: 12947
Joined: Fri May 29, 2009 6:57 pm

Re: incognito mode with Chrome runtime

Postby Rister » Wed Feb 12, 2025 3:47 am

magreenblatt wrote:The "Default" profile is always created by default but will only be used for non-incognito browsers.

Ok, probably some new/hidden logic introduced sometime before, but the documentation and all other info that can be found on the web shows that "if the cache_path is empty then the user data will be in memory" logic never changed and it should still work. Can you point out to a commit/discussion/doc page that shows that one now has to take something else into account if he or she wants to start in basically incognito mode?
Rister
Newbie
 
Posts: 7
Joined: Thu Nov 17, 2022 6:55 am

Re: incognito mode with Chrome runtime

Postby magreenblatt » Wed Feb 12, 2025 9:33 am

The documentation is correct. If cache_path is empty an incognito profile will be used.
magreenblatt
Site Admin
 
Posts: 12947
Joined: Fri May 29, 2009 6:57 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 29 guests