Don't set two "Electron"s in user agent
This commit is contained in:
parent
940db1d1dd
commit
1615c97ce8
1 changed files with 12 additions and 5 deletions
|
@ -62,11 +62,18 @@ AtomBrowserContext::~AtomBrowserContext() {
|
||||||
|
|
||||||
std::string AtomBrowserContext::GetUserAgent() {
|
std::string AtomBrowserContext::GetUserAgent() {
|
||||||
Browser* browser = Browser::Get();
|
Browser* browser = Browser::Get();
|
||||||
std::string user_agent = base::StringPrintf(
|
std::string name = RemoveWhitespace(browser->GetName());
|
||||||
"%s/%s Chrome/%s " ATOM_PRODUCT_NAME "/" ATOM_VERSION_STRING,
|
std::string user_agent;
|
||||||
RemoveWhitespace(browser->GetName()).c_str(),
|
if (name == ATOM_PRODUCT_NAME) {
|
||||||
browser->GetVersion().c_str(),
|
user_agent = "Chrome/" CHROME_VERSION_STRING " "
|
||||||
CHROME_VERSION_STRING);
|
ATOM_PRODUCT_NAME "/" ATOM_VERSION_STRING;
|
||||||
|
} else {
|
||||||
|
user_agent = base::StringPrintf(
|
||||||
|
"%s/%s Chrome/%s " ATOM_PRODUCT_NAME "/" ATOM_VERSION_STRING,
|
||||||
|
name.c_str(),
|
||||||
|
browser->GetVersion().c_str(),
|
||||||
|
CHROME_VERSION_STRING);
|
||||||
|
}
|
||||||
return content::BuildUserAgentFromProduct(user_agent);
|
return content::BuildUserAgentFromProduct(user_agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue