# Extending / Porting

Open <https://github.com/serbanghita/Mobile-Detect/blob/4.8.x/MobileDetect.json>

It contains all the information necessary to create a "mobile" detection script in any programming language. You can auto-import this periodically in your repository by checking the `version` property, which is updated on each release.

The following fields will help you create a Mobile Detect script in the language of your choice.

```json
{
    // Current released version. Respects semver.
    "version": "x.x.x",
    // Specific HTTP headers that attest for a "mobile" device.
    "headerMatch": { ... },
    // Array with HTTP header names that can potentially contain the "User-Agent" string.
    "uaHttpHeaders": [ ... ],
    // Amazon CloudFront headers.
    "cloudFrontHttpHeaders": [ ... ],
    // Regexes ordered by priority of "mobile" devices.
    "uaMatch": {
       "phones": { ... },
       "tablets": { ... },
       "browsers": { ... },
       "os": { ... }
    }
```

If you believe you need more fields or values, please [open a Github issue](https://github.com/serbanghita/Mobile-Detect/issues/new?assignees=serbanghita\&labels=feature\&projects=\&template=feature_request.md\&title=%5Bfeature%5D).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mobiledetect.net/home/extending-porting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
