Title: Detector
Author: steve.barnett
Published: <strong>2012 年 7 月 21 日</strong>
Last modified: 2012 年 9 月 10 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/detector.svg)

# Detector

 由 [steve.barnett](https://profiles.wordpress.org/stevebarnett-1/) 開發

[下載](https://downloads.wordpress.org/plugin/detector.0.9.5.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/detector/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/detector/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/detector/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/detector/#developers)

 [技術支援](https://wordpress.org/support/plugin/detector/)

## 外掛說明

[Detector](http://detector.dmolsen.com/) is a simple, PHP- and JavaScript-based 
browser- and feature-detection library that can adapt to new devices & browsers 
on its own without the need to pull from a central database of browser information.

Also available on GitHub: [https://github.com/SteveBarnett/Detector](https://github.com/SteveBarnett/Detector).

Full documentation is available at [github / dmolsen / Detector](https://github.com/dmolsen/Detector/).

### To Do

 * Add some useful responsive image handling, in the style of [picturefill.js](https://github.com/scottjehl/picturefill/).
   Based on families at first?
 * Add functions for conditional loading of content via JS, depending on screen 
   size.
 * wp_enqueue_script for Modernizr
 * Check Modernizr version, custom
 * Add option to add own [feature tests](https://github.com/dmolsen/Detector/wiki/Detector-Test-Tutorial)
   from admin area?
 * Add option to add own [families](https://github.com/dmolsen/Detector/wiki/Detector-Family-Tutorial)
   from admin area?
 * Add shortcodes?

## 安裝方式

 1. Go to Plugins > Add New, Upload and choose detector.zip.
 2. Activate the plugin.

## 常見問題集

  How do I use Detector?

In order to access the features you need to use the `$ua` object that is automatically
created with the inclusion of Detector in your application. Use the `$ua` object
in a similar way that you would have used the `Modernizr` object on the client-side:

    ```
    global $ua;

    // your script

    if ($ua->svg) {
        ...
    } elseif ($ua->canvas) {
        ...
    }
    ```

See the [full list of browser features](http://detector.dmolsen.com/demo/modernizr-listing/)
that are tested by Modernizr and available with Detector. All of the features tested
with [ua-parser-php](https://github.com/dmolsen/ua-parser-php) are also available
from the `$ua` variable (e.g. `$ua->isMobile` or `$ua->browserFull`)

Some features, (in particular `video`, `audio`, `input`, and `inputtypes`) have 
sub-features, so these are available as nested PHP objects:

    ```
    if ($ua->inputtypes->search) {
        print "<input type='search' ...";
    } else {
        print "<input type='text' ...";
    }
    ```

All features are returned as integer `1` or `0` for `true` or `false`, so they can
be used in logical evaluations in PHP. Sub-features can return `1`, `0`, or a real
value (e.g. screen width).

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Detector〉的開發相關工作。

參與者

 *   [ steve.barnett ](https://profiles.wordpress.org/stevebarnett-1/)

[將〈Detector〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/detector)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/detector/)、查看
[SVN 存放庫](https://plugins.svn.wordpress.org/detector/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/detector/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/detector/)。

## 變更記錄

#### 0.9.5

Updated to match dmoslen’s current Detector

#### 0.8.5

Updated to match dmoslen’s current Detector

#### 0.8.2

Updated to match dmoslen’s current Detector

#### 0.8.1

 * Initial release. [regexes.yaml from 2012/07/12: 303c8f9](https://github.com/tobie/ua-parser/commit/303c8f905aa34110467cdfe730cf066ae6f6e18e#regexes.yaml)

## 中繼資料

 *  版本 **0.9.5**
 *  最後更新 **14 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 3.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **3.0.5**
 *  語言
 * [English (US)](https://wordpress.org/plugins/detector/)
 * 標籤:
 * [detector](https://tw.wordpress.org/plugins/tags/detector/)[device](https://tw.wordpress.org/plugins/tags/device/)
   [modernizr](https://tw.wordpress.org/plugins/tags/modernizr/)
 *  [進階檢視](https://tw.wordpress.org/plugins/detector/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/detector/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/detector/reviews/)

## 參與者

 *   [ steve.barnett ](https://profiles.wordpress.org/stevebarnett-1/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/detector/)