Is there any way to add referrer header? #3883
Replies: 12 comments
-
Show us the code of |
Beta Was this translation helpful? Give feedback.
-
Hi @Symbai baseTemplate.AddTab is custom way to create tabs. AddTab has following implementation
|
Beta Was this translation helpful? Give feedback.
-
I guess its because you create a new webview2 and visit the url (which then has no referrer). No tested by you can try using the Anyway to answer your original question, changing http header is done by |
Beta Was this translation helpful? Give feedback.
-
Sorry, but is there any code sample which I can follow? |
Beta Was this translation helpful? Give feedback.
-
@Symbai @Dave-Jalpan If you use @Dave-Jalpan You've already had a sample here: #873 |
Beta Was this translation helpful? Give feedback.
-
@ukandrewc |
Beta Was this translation helpful? Give feedback.
-
@Dave-Jalpan Sorry, I can't help any more, I did answer that question, but I'm very rusty on C++, so can't help with that. |
Beta Was this translation helpful? Give feedback.
-
Is this interpretation correct from vb to c# Friend Deferral As CoreWebView2Deferral
and Dim Browser As New MyWebView2
if so then i am not able to set deferral
|
Beta Was this translation helpful? Give feedback.
-
@Dave-Jalpan Internals are correct but MyWebView2, needs to be your own inherited class
|
Beta Was this translation helpful? Give feedback.
-
@ukandrewc
|
Beta Was this translation helpful? Give feedback.
-
The NewWindowRequested notification is simply to let your code know that the web page wants a new window. If you take over the processing, it's up to you to create that new window containing a WebView2 and have that new WV2 pick up the navigation using the deferral. So, it's up to you to create a window and hook up its close event. |
Beta Was this translation helpful? Give feedback.
-
Usually I handled all new window request to open new tab (WebView2). But one of the website need header referrer.
It not reaching WebView2_NewWindowInitialized to complete deferral
|
Beta Was this translation helpful? Give feedback.
-
I want to open a new tab instead of new window. But while doing that one of the application throws exception "Error: No referrer", as application is expecting referrer value in header. So how I can pass referrer in header from e.NewWindow while redirecting new window request to new tab?
Beta Was this translation helpful? Give feedback.
All reactions