如何修改chromium的user-agent

在chrome工程下webkit/support/glue 工程里面,有个webkit_glue.cc的文件,找到里面这么一行

StringAppendF(
result,
“Mozilla/5.0 (%s; %c; %s; %s) AppleWebKit/%d.%d”
” (KHTML, like Gecko) %s Safari/%d.%d”,
mimic_windows ? “Windows” : kUserAgentPlatform,
kUserAgentSecurity,
((mimic_windows ? “Windows ” : “”) + BuildOSCpuInfo()).c_str(),
kUserAgentLocale,
WEBKIT_VERSION_MAJOR,
WEBKIT_VERSION_MINOR,
product.c_str(),
WEBKIT_VERSION_MAJOR,
WEBKIT_VERSION_MINOR
);
这就是chromium生成user-agent的语句,可以随便修改了

Related Posts

Comments 2

  1. clickstone wrote:

    你这上来先研究怎么搞伪装,没安啥好心啊!

    Posted 20 七 2010 at 11:15 下午
  2. xlvector wrote:

    哈哈,他们的想法是吧user-id直接嵌入到user-agent里面,这样方便日志统计了。我只负责执行,哈哈

    Posted 21 七 2010 at 8:12 下午

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word