How can I determine whether the browser is a 360 browser?

Source: Internet
Author: User
How can I determine whether the browser is a 360 browser php code or js code? Baidu won't be able to do this for several times,
For the 360 browser version 5.0


Reply to discussion (solution)

Capture the package and check what the browser features 360 are and then determine.
But now many browsers can install plug-ins to simulate other browsers.

SERVER ["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)

You can use predefined variables:
$ _ SERVER ['http _ USER_AGENT ']
The following code is used:
$ Agent = $ _ SERVER ["HTTP_USER_AGENT"];
If (strpos ($ agent, "MSIE 8.0 "))
Echo & quot; Internet Explorer 8.0 & quot ";
Else if (strpos ($ agent, "MSIE 7.0 "))
Echo & quot; Internet Explorer 7.0 & quot ";
Else if (strpos ($ agent, "MSIE 6.0 "))
Echo & quot; Internet Explorer 6.0 & quot ";
Else if (strpos ($ agent, "Firefox/3 "))
Echo "Firefox 3 ";
Else if (strpos ($ agent, "Firefox/2 "))
Echo "Firefox 2 ";
Else if (strpos ($ agent, "Chrome "))
Echo "Google Chrome ";
Else if (strpos ($ agent, "Safari "))
Echo "Safari ";
Else if (strpos ($ agent, "Opera "))
Echo & quot; 360 & quot ";
Else echo $ agent;
?>

Http://www.google.com.hk/#hl=zh-CN&newwindow=1&safe=strict&site=&source=hp&q=js+%E5%88%A4%E6%96%AD360%E6%B5%8F%E8%A7%88%E5%99%A8&oq=js+%E5%88%A4%E6%96%AD360%E6%B5%8F%E8%A7%88%E5%99%A8&gs_l=hp.3...2337.9890.0.10172.8.8.0.0.0.0.0.0..0.0...0.0..0.1c.uam8R2beIKM&bav=on.2,or.r_gc.r_pw.&fp=a16bbb3ab964cbca&biw=1366&bih=664

To #4 what people need is a 360 browser 5.0 logo

Unfortunately, the 360 browser uses the IE kernel and strictly says it uses the webbrowse COM control.
So it is impossible to include your copyright information.

Please take a look at the source file of the http://hao.360.cn/sethomepage.html to see how 360 self judgment ......

Or look at the http://www.162100.com/sethomepage.php

The JS part should be

Var is360 = false;
Try {
If (window. external & window. external. twGetRunPath ){
Var r = external. twGetRunPath ();
If (r & r. toLowerCase (). indexOf ("360")>-1 ){
Is360 = true;
}
}
} Catch (e ){
Is360 = false;
}
If (is360 ){
BrowserMark = '000000 ';
} Else {
Var nVersion = navigator. appVersion;
If (/2345 Explorer/I. test (nVersion )){
BrowserMark = '000000 ';
} Else if (/Maxthon/I. test (nVersion )){
BrowserMark = 'maxthon ';
} Else if (/TheWorld/I. test (nVersion )){
BrowserMark = 'theworld ';
} Else if (/TencentTraveler/I. test (nVersion )){
BrowserMark = 'TT ';
} Else if (/SE. * MetaSr/I. test (nVersion )){
BrowserMark = 'sogou ';
} Else if (/QQbrowser/I. test (nVersion )){
BrowserMark = 'QQ ';
} Else if (/GreenBrowser/I. test (nVersion )){
BrowserMark = 'green ';
} Else if (/360EE/I. test (nVersion )){
BrowserMark = '360ee ';
} Else if (/Chrome/I. test (nVersion )){
BrowserMark = 'chromi ';
} Else if (/Firefox/I. test (navigator. userAgent )){
BrowserMark = 'Firefox ';
} Else if (/Opera/I. test (navigator. userAgent )){
BrowserMark = 'Opera ';
} Else if (/Safari/I. test (navigator. userAgent )){
BrowserMark = 'Safari ';
} Else {
BrowserMark = 'Ie ';
}
}

#7. #8 seems reasonable
But when I tested it with a 360 security browser, he didn't recognize himself.

360 is about to remove these marks. Du Niang won't let go of anything about him.

It's very painful. I am also struggling with this issue. 360 is so rogue ~ The mark is not left behind. the 360 million evil people, the user also asked me to add a 360 judgment.

I tested the 8th floor, but it is useless.

Window. external. twGetRunPath can only be called by webpages under the 360.cn domain name.

No other web pages can call this kind of rogue behavior. you have the urge to scold them, but you can't bear it. In fact, you have been scolded for countless times.

Use $ _ SERVER ["HTTP_USER_AGENT"] to read the information of the 360 browser. The result is exactly the same as that of IE8.

Why did Microsoft not sue him?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.