Page 2 of 2

Re: LoadRequest in Cef simple apllication

PostPosted: Tue Oct 19, 2021 3:59 am
by chayal
Hi,
Thanks for the help. It worked !!! I was able to modify the URL and load the request.
I have one more doubt:
I implemented OnBeforeResourceLoad and modified request headers but I am not able to set Referer header as "about:blank" .
I tried it by 2 methods:
1 . Method I:
CefRequest::HeaderMap headerMap;
request->GetHeaderMap(headerMap);
headerMap.insert(std::make_pair(CefString("Referer"), CefString("about:blank")));
request->SetHeaderMap(headerMap);

2. Method 2:
CefString referrer = "about:blank";
CefRequest::ReferrerPolicy policy = REFERRER_POLICY_ORIGIN;
request->SetReferrer(referrer, policy);

In both the cases I don't see the Referer header added into the list of headers we see on fiddler app.
What is the correct way of doing this.
Thanks in advance.