Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incognito mode support #779

Closed
ztextplus opened this issue Dec 31, 2020 · 24 comments
Closed

incognito mode support #779

ztextplus opened this issue Dec 31, 2020 · 24 comments
Assignees
Labels
feature request feature request tracked We are tracking this work internally.

Comments

@ztextplus
Copy link

ztextplus commented Dec 31, 2020

I need WebView2 to support incognito mode. Is there a solution?

AB#31044529

@ztextplus ztextplus added the feature request feature request label Dec 31, 2020
@hunkydoryrepair
Copy link

This has come up before and the response was you need to do it on your own by deleting the data from user folder.

@jasonstephen15
Copy link
Contributor

jasonstephen15 commented Dec 31, 2020

Hi @ztextplus, I'd like to understand your use case some more. Do you mind expanding on what your app is trying to do and how its planning on using incognito mode? Is your app a browser, trying to replicate edge's incognito experience?

@jasonstephen15 jasonstephen15 self-assigned this Dec 31, 2020
@ztextplus
Copy link
Author

@jasonstephen15 We use Webview2 in our client to run web applications. If the user logs in to our client and does not choose to save the username and password, we want to run Webview2 in incognito mode so that no cache data will be saved to the file.

We tried to delete the cache folder when we exited, but because the cache folder is occupied by Webview2, it cannot be deleted successfully every time.

@jasonstephen15
Copy link
Contributor

Does an api to manage/clear cache work for your purposes? Assuming this api works during runtime would it be a workaround to a full fledged 'incognito mode'?

@ztextplus
Copy link
Author

ztextplus commented Jan 11, 2021

@jasonstephen15 If Webview2 can provide an API, it is also an acceptable solution, because Webview2 itself can release the file occupation first, and then clear the cache files.

@danyi1212
Copy link

I'm also searching for Incognito support in order to avoid the IIS Windows Authentication with the credentials of the logged on user. Do you have any idea how can I do so?

@djlorentz
Copy link

djlorentz commented Apr 6, 2021

Hi @jasonstephen15, I also want to avoid caching entirely.

My use case is we that are providing user tablets that allow access to PII with HIPAA style regulations on privacy. The tablets are deployed in a kiosk style mode where the end user shell is the browser app. We do not want any caching on disk so if a tablet is lost we have not lost PII (we can revoke device access to the backend resources at the server side).

Currently we are using the cefsharp browser component with the in memory cache backend but would like to move to webview2 evergreen to use the windows update process to keep the browser component patched.

Providing the same in memory cache as cefsharp by default would also help with #297 and possibly #299

@hunkydoryrepair
Copy link

What does HIPAA say about the swap file? Do you disable the swap file to prevent PII from getting written there? You probably will need to create a RAM disk to use as a cache location. Modern browsers just won't function without some kind of cache, but I'm in a similar position. Our app is also kiosk mode and so need to eliminate personal information from just auto-filling. With all the privacy concerns these days I'm surprised Edge team is so careless with it. But that's more an Edge issue and WebView2 team is trying to work around their decisions.

@vmeganathan81
Copy link

Do we have an ETA for this feature ?

@vmeganathan81
Copy link

@jasonstephen15 , do we have an ETA for this feature ?

@vmeganathan81
Copy link

We use Webview2 in our client to run web applications. If the user logs in to our client and does not choose to save the username and password, we want to run Webview2 in incognito mode so that no cache data will be saved to the file.

We tried to delete the cache folder when we exited, but because the cache folder is occupied by Webview2, it cannot be deleted successfully every time.

Same here as well, do we know when would this feature be available, I see the last update in Dec 2020

@vmeganathan81
Copy link

@david-risney , any update on this feature.

@david-risney
Copy link
Contributor

We may be looking into it in the near future. I don't have any specific dates though.

@neostfox
Copy link

neostfox commented Nov 3, 2021

wait for this

@nirdil
Copy link

nirdil commented Dec 20, 2021

Why not just run from a new temporary user data folder in that case?
Something like this before creating the webview:

 Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", Path.Combine(Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "Incognito", new Random().Next().ToString())));

Also, I'm not sure if that suffices but for real incognito you should also disable MS SmartScreen:

 Environment.SetEnvironmentVariable("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", "--disable-features=msSmartScreenProtection");

@LucaZiegler
Copy link

Why not just run from a new temporary user data folder in that case? Something like this before creating the webview:

 Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", Path.Combine(Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "Incognito", new Random().Next().ToString())));

Also, I'm not sure if that suffices but for real incognito you should also disable MS SmartScreen:

 Environment.SetEnvironmentVariable("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", "--disable-features=msSmartScreenProtection");

Thank you, you are a genius!
I can now use multiple MSAL accounts to login and use them for the Graph API.

@marekpetak
Copy link

marekpetak commented Apr 8, 2022

Any news on this? The above solution is OK, but not what I would expect from the API. We should have something like

webView.EnableIncognito = true;

or

webView.ClearChache();

Thanks

@champnic champnic added the tracked We are tracking this work internally. label May 10, 2022
@mayur-agarwal-lrn
Copy link

I am waiting for private mode too or clear cache/cookies.
Any updates on this feature request?

@david-risney
Copy link
Contributor

InPrivate is supported via the CoreWebView2ControllerOptions.IsInPrivateModeEnabled

@mayur-agarwal-lrn
Copy link

How to use it in a WPF application with a WebView2 control in it? Can you point to any documentation?
As far as I have researched, ControllerOptions are not available for the control.

@champnic
Copy link
Member

champnic commented Feb 1, 2023

@champnic champnic closed this as completed Feb 1, 2023
@vmeganathan81
Copy link

It's available now..?

@vmeganathan81
Copy link

@champnic is it available now, if yes could you share link for samples

@champnic
Copy link
Member

champnic commented Feb 2, 2023

Yes this is available now. I linked the APIs above, and here is the sample (in Win32):
https://github.com/MicrosoftEdge/WebView2Samples/blob/1710d535e895ed9c24196c5482e990e10d7285c7/SampleApps/WebView2APISample/AppWindow.cpp#L1343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests