Per browser user agent fails to apply

Issue #2284 resolved
Former user created an issue

Calling CefBrowser::SetUserAgentOverride() with a non-empty string will not result in the UA being used for network requests.

Suggested Fix is to change the LoadURL call to this in CefBrowserHostImpl::LoadURL

        content::NavigationController::LoadURLParams params( gurl );
        params.referrer = referrer;
        params.transition_type = transition;
        params.extra_headers = extra_headers;
        params.frame_tree_node_id = frame_id;

        if ( !web_contents_->GetUserAgentOverride().empty() )
            params.override_user_agent =
            content::NavigationController::UA_OVERRIDE_TRUE;

        web_contents_->GetController().LoadURLWithParams( params );
        OnSetFocus(FOCUS_SOURCE_NAVIGATION);

Comments (3)

  1. Marshall Greenblatt

    What CEF version are you using? There is no CefBrowser::SetUserAgentOverride method in CEF3.

  2. Former user Account Deleted reporter

    Oh, I guess I have another patch to generate to add that support then, sorry for the noise.

  3. Log in to comment