User agent string is incorrect in newly opened webview

Bug #1324909 reported by Chris Coulson on 2014-05-30
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Oxide
High
Chris Coulson

Bug Description

When a new webview is opened via window.open() and the new webview is in the same render process as the opener, the user agent string is incorrect until the first browser-initiated navigation

Chris Coulson (chrisccoulson) wrote :
Changed in oxide:
importance: Undecided → High
status: New → Triaged
Chris Coulson (chrisccoulson) wrote :
Chris Coulson (chrisccoulson) wrote :
Chris Coulson (chrisccoulson) wrote :

Setting the user agent string is done in 2 places:

- Setting RendererPreferences::user_agent_override
- Setting FrameMsg_Navigate_Params::is_overriding_user_agent, which is sent with the FrameMsg_Navigate IPC message for browser initiated navigations

content::RenderFrameImpl::userAgentOverride() only returns the override user agent string if InternalDocumentStateData::is_overriding_user_agent() returns true. InternalDocumentStateData is an object tied to the WebDataSource associated with a frame. It is created in content::RenderFrameImpl::didCreateDataSource(), where:

- If there is a pending browser-initiated navigation, InternalDocumentStateData::set_is_overriding_user_agent() is called with the value set from the FrameMsg_Navigate message.
- If the navigation is content initiated, InternalDocumentStateData::set_is_overriding_user_agent() is called with the value from the previous data source associated with the frame.

For a newly opened webview, none of the above 2 conditions are met, and so the setting gets lost

Chris Coulson (chrisccoulson) wrote :

I bet this is broken for subframes too

Changed in oxide:
status: Triaged → Fix Released
Changed in oxide:
milestone: none → branch-1.1
Changed in oxide:
assignee: nobody → Chris Coulson (chrisccoulson)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers