Skip to content

Commit c012b25

Browse files
committed
set renderer command line arg for user-agent
This will set the default UA in WebKitPlatformSupport by content_main_runner.cc Fix nwjs#806
1 parent 67f36d2 commit c012b25

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/shell_content_browser_client.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ void ShellContentBrowserClient::AppendExtraCommandLineSwitches(
181181
if (content::IsThreadedCompositingEnabled())
182182
command_line->AppendSwitch(switches::kEnableThreadedCompositing);
183183

184+
std::string user_agent;
185+
if (!command_line->HasSwitch(switches::kUserAgent) &&
186+
GetUserAgentManifest(&user_agent)) {
187+
command_line->AppendSwitchASCII(switches::kUserAgent, user_agent);
188+
}
184189
if (child_process_id > 0) {
185190
content::RenderWidgetHost::List widgets =
186191
content::RenderWidgetHost::GetRenderWidgetHosts();

0 commit comments

Comments
 (0)