- Code: Select all
CefRequestHandler::ReturnValue SimpleHandler::OnBeforeResourceLoad(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request,
CefRefPtr<CefRequestCallback> callback)
{
CefRequest::ReferrerPolicy origin = REFERRER_POLICY_ALWAYS;
request->SetReferrer("https://www.google.com/",origin);
return RV_CONTINUE;
}
Is there anyway to do this in JCEF? I am not seeing a method under CEFRequest to do this. I am going to try SetHeaderMap. I thought I read in one forum post that that only adds to the information instead of changes it.
Anyone have an example of doing this that contains the following information.
What HTTP Headers is my browser sending?
ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
ACCEPT_ENCODING gzip, deflate, br
ACCEPT_LANGUAGE en-US,en;q=0.5
CONNECTION keep-alive
HOST http://www.whatismybrowser.com
REFERER https://www.google.com/
UPGRADE_INSECURE_REQUESTS 1
USER_AGENT Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0