Page 1 of 1
Secret mode or Incognito
Posted: Fri Jan 31, 2025 6:49 pm
by sodlf159
WVBrowser1.IsInPrivateModeEnabled := True;
WVBrowser1.CreateBrowser(WVWindowParent1.Handle);
or
procedure TMainForm.WVBrowser1NavigationStarting(Sender: TObject;
const aWebView: ICoreWebView2;
const aArgs: ICoreWebView2NavigationStartingEventArgs);
begin
if not isReSet then
begin
isReSet := True;
WVBrowser1.ClearBrowsingDataAll;
Sleep(100);
WVBrowser1.Refresh;
end;
end;
Re: Secret mode or Incognito
Posted: Sat Feb 01, 2025 11:30 am
by salvadordf
Setting IsInPrivateModeEnabled to True is the preferred method.
Re: Secret mode or Incognito
Posted: Sun Feb 02, 2025 7:48 pm
by sodlf159
WindowlessBrowser
Can you give me an example of how to control clicks?
And the window does not disappear.
Re: Secret mode or Incognito
Posted: Mon Feb 03, 2025 8:37 am
by salvadordf
Modify the TMainForm.HandleMouseMessage function to filter the mouse clicks.
If necessary, avoid the WVBrowser1.SendMouseInput call for some clicks.
Re: Secret mode or Incognito
Posted: Mon Feb 03, 2025 9:17 am
by sodlf159
The window doesn't disappear?
It's not headless mode.
Re: Secret mode or Incognito
Posted: Tue Feb 04, 2025 2:55 pm
by salvadordf
The WindowlessBrowser uses the DirectComposition API :
https://github.com/MicrosoftEdge/WebView2Feedback/issues/20
https://docs.microsoft.com/en-us/windows/win32/directcomp/directcomposition-portal
A true headless browser may use an off-screen rendering mode like the OSR mode in CEF but that feature is still not implemented by Microsoft :
https://github.com/MicrosoftEdge/WebView2Feedback/issues/547
The WindowlessBrowser demo allows you to have more control over mouse events but the application still has to initialize the browser using a TWVDirectCompositionHost instance.