Hello.
What's is best practices to properly implement LoadURL(url, referrer) method?
Topic modeled on CEF 57.
Approach #1: Attempt to use LoadRequest
Basically we easily can create request for browser and call Frame::LoadRequest.
Question: What is drawbacks? Do request will be same as browser-generated (in terms of headers)?
Problem: When browser created with "about:blank" starting URL, then call LoadRequest to actual navigating - referrer is not set.
Next LoadRequest call work as expected - referrer is overriden as expected.
If it is bug - then let's fill bug?
Approach #2: Attempt to use OnBeforeResourceLoad
We can intercept request in OnBeforeResourceLoad and set referrer in this method. But this solution turns problem from one to another: now we need to identify correct request which requires referrer override. Also, i think, we loosing referrer policies in that case.
What's is reliable way or best practices to detect correct request here?
Approach #3: Hybrid
Of course it is fairly easily to combine #1 and #2 together (in that case we need handle only first navigation-related resource load) - but feels like dirty workaround.
What's correct way to deal with?