The virtual OnBeforeResourceLoad method is here (2nd method down): apidocs/projects/%28default%29/cef_request_handler.h.html
In my simple_handler.h located in my binary folder/ cefsimple/, I added the following text:
virtual CefRefPtr<CefRequestHandler> GetRequestHandler() override {
return this;
} //thank alexeibs from stackoverflow for this
virtual CefRequestHandler::ReturnValue OnBeforeResourceLoad(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request,
CefRefPtr<CefRequestCallback> callback) OVERRIDE ;
in my Simple_handler.cc located in my project folder, I have the following:
CefRequestHandler::ReturnValue SimpleHandler::OnBeforeResourceLoad(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request,
CefRefPtr<CefRequestCallback> callback)
{
std::string str1 = "http://magpcss.org/ceforum/apidocs3/projects/%28default%29/CefFrame.html#LoadString%28constCefString&,constCefString&%29";
CefRequest::ReferrerPolicy origin = REFERRER_POLICY_ALWAYS;
request->SetReferrer(str1,origin);
return RV_CONTINUE;
}
I have tried changing the Referrer policy to each available option but that did not help.
Everything compiles, but the Referer is not set, any ideas why?
happy to paste entire files if necessary.
I looked at the OnLoadError code in the SimpleHandler class. It is being implemented in the same way my function is, but it seems the setreffer method is not being called. IN the comments of OnBeforeResourceLoad, It states that the request object is able to be modified.
Any input on where I am not setting the referrer properly is appreciated