
# 奇虎 360 浏览器


奇虎旗下有两款浏览器：

1. [360 安全浏览器](http://se.360.cn/)
2. [360 极速浏览器](http://chrome.360.cn/)

实际安装测试两款浏览器均提供了双核。

360 浏览器在访问不同域名的网站时，会设置不同的 UA 信息，比如访问
[360 自己的网站](http://se.360.cn/wel/6.1s.html) 时，
可以获得浏览器相关信息，external 扩展能力也更多。

|                                | 360 安全浏览器                                                                                                                                          | 360 极速浏览器                                                                                                                                          |
|--------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| 测试版本                       | 6.1.0.320                                                                                                                                               | 7.0.0.828                                                                                                                                               |
| 极速模式（默认）               | Chromium                                                                                                                                                | Chromium                                                                                                                                                |
| 兼容模式                       | IE                                                                                                                                                      | IE                                                                                                                                                      |
| UA(极速模式)                   | Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1                                                     | Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17                                                   |
| UA(兼容模式)                   | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0) | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0) |
| UA(极速模式，首个页面 console) | Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1 QIHU 360SE                                          | Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17 QIHU 360EE                                        |

另外，这两款浏览器的 `window.external` 提供了相同的 API：

```javascript
window.external = {
    AddSearchProvider: function(name),
    AppCmd: function(s1,s2,s3,s4,s5,cb1),
    GetMID: function(sid),
    GetRunPath: function(sid),
    GetSID: function(url),
    GetVersion: function(sid),
    IsSearchProviderInstalled: function(name)
}
```

## UserAgent

Windows 7, 360SE 5.0.3.1

| 字段         | 值                                                                                                                                                      |
|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| ua           | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0) |
| vendor       | undefined                                                                                                                                               |
| vendorSub    | undefined                                                                                                                                               |
| platform     | Win32                                                                                                                                                   |
| external     | {}                                                                                                                                                      |
| appCodeName  | Mozilla                                                                                                                                                 |
| appName      | Microsoft Internet Explorer                                                                                                                             |
| appVersion   | 4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)         |
| product      | undefined                                                                                                                                               |
| productSub   | undefined                                                                                                                                               |
| screenWidth  | 1237                                                                                                                                                    |
| screenHeight | 727                                                                                                                                                     |
| colorDepth   | 32                                                                                                                                                      |
| documentMode | 7                                                                                                                                                       |
| compatMode   | CSS1Compat                                                                                                                                              |

`window.external` == `[object Object]`
`external.twGetVersion(external.twGetSecurityID(window))` 返回版本号。
`external.twGetRunPath` 返回 360SE 安装路径。

----

Windows 7, 360SE 4.0.2.3

| 字段         | 值                                                                                                                                                      |
|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| ua           | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0) |
| vendor       | undefined                                                                                                                                               |
| vendorSub    | undefined                                                                                                                                               |
| platform     | Win32                                                                                                                                                   |
| external     | {}                                                                                                                                                      |
| appCodeName  | Mozilla                                                                                                                                                 |
| appName      | Microsoft Internet Explorer                                                                                                                             |
| appVersion   | 5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)         |
| product      | undefined                                                                                                                                               |
| productSub   | undefined                                                                                                                                               |
| screenWidth  | 1237                                                                                                                                                    |
| screenHeight | 727                                                                                                                                                     |
| colorDepth   | 24                                                                                                                                                      |
| documentMode | 9                                                                                                                                                       |
| compatMode   | CSS1Compat                                                                                                                                              |

----

Windows 7, 360SE 3.2.0.7

| 字段         | 值                                                                                                                                                             |
|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ua           | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; 360SE) |
| vendor       | undefined                                                                                                                                                      |
| vendorSub    | undefined                                                                                                                                                      |
| platform     | Win32                                                                                                                                                          |
| external     | {}                                                                                                                                                             |
| appCodeName  | Mozilla                                                                                                                                                        |
| appName      | Microsoft Internet Explorer                                                                                                                                    |
| appVersion   | 4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; 360SE)         |
| product      | undefined                                                                                                                                                      |
| productSub   | undefined                                                                                                                                                      |
| screenWidth  | 1237                                                                                                                                                           |
| screenHeight | 727                                                                                                                                                            |
| colorDepth   | 32                                                                                                                                                             |
| documentMode | 7                                                                                                                                                              |
| compatMode   | CSS1Compat                                                                                                                                                     |

只有 IE 单内核。

alert(window.external) 弹出 undefined，但是：

- `window.external == undefined` 为 false
- `window.external == null` 为 false
- `!!window.external` 为 true

----

Windows XP, 360SE v6.0

* IE, Chromium 双核
* userAgent 中不携带 360 信息。
* `window.external.notExistsMethod()` 会报错。
* `window.external.twGetRunPath` 返回 undefined。
* `window.external.twGetSecurityID(window)` 报错。
* `window.external.twGetVersion(window.external.twGetSecurityID(window))` 报错。
* 特定域名（如 http://se.360.cn/wel/6.1s.html ）支持新的 API。可惜不提供给绝大部分网站。
    * `window.external.GetMID()`
    * `window.external.GetSID(window)`
    * `window.external.GetRunPath(window.external.GetSID(window))`
    * `window.external.GetVersion(window.external.GetSID(window))`

----

Windows XP, 360SE v5.0

* IE 单核
* userAgent 中携带 360SE 信息，无版本信息。

    ```
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; 360SE)
    ```
* `window.external.notExistsMethod()` 会报错。
* `window.external.twGetRunPath` 返回 360 安装路径。
* `window.external.twGetSecurityID(window)` 返回 undefined。
* `window.external.twGetVersion(window.external.twGetSecurityID(window))` 返回真实版本号。

----

Windows XP, 360SE v4.0

* IE 单核
* userAgent 中携带 360SE 信息，无版本信息。
* `window.external.notExistsMethod()` 返回 undefined，不会报错。
* `window.external.twGetRunPath` 返回 360 安装路径。
* `window.external.twGetSecurityID(window)` 返回 undefined。
* `window.external.twGetVersion(window.external.twGetSecurityID(window))` 返回真实版本号。

| 字段         | 值                                                                                 |
|--------------|------------------------------------------------------------------------------------|
| ua           | Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; 360SE) |
| vendor       | undefined                                                                          |
| vendorSub    | undefined                                                                          |
| platform     | Win32                                                                              |
| external     | {}                                                                                 |
| appCodeName  | Mozilla                                                                            |
| appName      | Microsoft Internet Explorer                                                        |
| appVersion   | 4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; 360SE)         |
| product      | undefined                                                                          |
| productSub   | undefined                                                                          |
| screenWidth  | 1164                                                                               |
| screenHeight | 727                                                                                |
| colorDepth   | 32                                                                                 |
| documentMode | undefined                                                                          |
| compatMode   | CSS1Compat                                                                         |

----

Windows XP, 360SE v3.0

* IE 单内核
* userAgent 中携带 360SE 信息，无版本信息。
* `window.external.notExistsMethod()` 返回 undefined，不会报错。
* `window.external.twGetRunPath` 返回 360 安装路径。
* `window.external.twGetSecurityID(window)` 返回 undefined。
* `window.external.twGetVersion(window.external.twGetSecurityID(window))` 返回真实版本号。

----

Windows XP, 360SE v2.0

* IE 单内核
* `typeof window.external === "object"`，但没有遍历出可用的属性或方法。
* `window.external.notExistsMethod()` 返回 undefined，不会报错。

----

Windows XP, 360 v1.0

* IE 内核。
* `typeof window.external === "object"`，但没有遍历出可用的属性或方法。


## 延伸阅读

* [360浏览器隐藏UA “变脸”盗取用户数据](http://news.ctocio.com.cn/475/12416475.shtml)
* [360浏览器自动升级伪装](http://www.williamlong.info/archives/2390.html)
