Welcome Guest Search | Active Topics | Sign In | Register

Open new window in the same WebView Options
ozheek
Posted: Monday, April 22, 2019 8:43:33 PM
Rank: Advanced Member
Groups: Member

Joined: 8/29/2016
Posts: 64
Is it possible to prevent opening new Windows in new WebView and navigate in the same WebView but keep Referer?

To keep Referer I can't just catch the event NewWindow and Navigate in the same WebView as Referer will be cleared.

The second question. Is it possible navigate WebView with sending Referer header?
eo_support
Posted: Friday, April 26, 2019 3:58:58 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

You can do something like this:

Code: C#
EO.WebBrowser.WebView webView = (EO.WebBrowser.WebView)sender;
EO.WebBrowser.Request r = new EO.WebBrowser.Request(e.TargetUrl);
r.Headers["Referer"] = webView.Url;
webView.LoadRequest(r);


The key is to use EO.WebBrowser.Request object and WebView.LoadRequest method. This allows you to set referer yourself.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.