Amazon Silk
Developer Guide
« PreviousNext »
View the PDF for this guide.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Amazon Silk User Agent

In the request headers, Silk supplies one of two user agent strings: desktop or mobile. The desktop user agent indicates that the browser is requesting the standard desktop version of the page. The mobile user agent requests a mobile view of the page. The specific user agent sent depends on the view requested, but by default Silk requests the desktop view. Thus, most requests from Silk will include the desktop user agent string.

At the Menu, the user can request a particular view for a domain.

A dialog presents three view options: Automatic, Desktop, and Mobile.

If the user selects Desktop or Mobile, Silk sends the corresponding user agent string in the HTTP request. If the user selects Automatic (the default setting), Silk automatically determines which user agent string to send. Silk requests the desktop view except in cases where a mobile view provides a better user experience.

User Agent Overview

The general templates for the Silk user agent on the Kindle Fire, Kindle Fire HD, and Kindle Fire HDX are shown below.

Desktop

Mozilla/5.0 (Linux; U; localeproduct-model Build/product-build)
    AppleWebKit/webkit-version (KHTML, like Gecko) Silk/browser-version Safari/webkit-version
    Silk-Accelerated=cloud-browsing-state

Mobile

Mozilla/5.0 (Linux; U; Android android-versionlocaleproduct-model Build/product-build)
    AppleWebKit/webkit-version (KHTML, like Gecko) Silk/browser-version Mobile Safari/webkit-version 
    Silk-Accelerated=cloud-browsing-state

Note

Red fields are variable and are described below.

Template fields

  • locale–Indicates the chosen language and country or region for the tablet. Locale is in hyphenated lowercase format, as in en-us (US English). For Kindle Fire (1st Generation), locale is always en-us.

  • product-model–The value of Build.MODEL (for example, KFTT).

  • android-version–The Android platform version (for example, 4.0.3).

  • product-build–The value of Build.ID (for example, IML74K).

  • webkit-version–Indicates the version of WebKit used (for example, 535.19). This value can change whenever the Kindle Fire receives a software update.

  • browser-version–Indicates the version of the Silk browser, in the format major.minor (for example, 2.1). The browser version can change whenever the Kindle Fire receives a software update.

  • cloud-browsing-state–This value is set to true if cloud browsing is enabled, and false if cloud browsing is not enabled. Users can change this setting on the device. When cloud browsing is not enabled, the request is sent directly to origin. When cloud browsing is enabled, the request may be sent either through the cloud or directly to origin, depending upon various factors. In other words, a value of Silk-Accelerated=true does not necessarily mean that a request was sent through the cloud.

Related product models

  • Kindle FireKFOT

  • Kindle Fire HDKFTT

  • Kindle Fire HD 8.9"KFJWI

  • Kindle Fire HD 8.9" 4GKFJWA

  • Kindle Fire HD 7" (3rd Generation)KFSOWI

  • Kindle Fire HDX 7" (3rd Generation)KFTHWI

  • Kindle Fire HDX 7" (3rd Generation) 4GKFTHWA

  • Kindle Fire HDX 8.9" (3rd Generation)KFAPWI

  • Kindle Fire HDX 8.9" (3rd Generation) 4GKFAPWA

Client IP Address and cloud-browsing-state

In cases where the Silk-Accelerated parameter is set to false, the source IP address of the request can be obtained as it normally would be on any HTTP request.

However, in cases where Silk-Accelerated is set to true, the source IP address of the request may be the IP address of the Amazon Silk cloud server. In this case the source IP address of the end client is supplied in the X-Forwarded-For request header. Note that different requests from a single end user may be routed through different cloud servers. In other words, a website may receive a series of requests from different source IP addresses but with the same X-Forwarded-For header.

Additionally, a single Amazon Silk cloud server can support multiple end users. This means that a website may see requests with the same source IP address but different X-Forwarded-For headers.

Mapping the User Agent to the Build Version

In addition to the browser version included in the user agent string, each version of Amazon Silk includes a build version.

You can view the Silk build version on a Kindle Fire device. To do so, enter about:version in the address bar. Silk will display the build version string.

In some troubleshooting scenarios, you may need to know both the browser and build versions for a given Silk client. The following table maps the current Silk browser version to build versions. For each browser version there can be several build versions, each of which corresponds to a generation of Kindle Fire devices. To learn more about Kindle Fire device types, see the Kindle Support device list.

Note

The version of Silk running on 1st Gen devices is identified only by build version, and not by a browser version.

Silk Browser VersionSilk Build Version
 1st Gen—Kindle Fire2nd Gen—Kindle Fire HD 8.9"; Kindle Fire HD 7"; Kindle Fire (2nd Gen)3rd Gen—Kindle Fire HDX 8.9"; Kindle Fire HDX 7"; Kindle Fire HD 7" (3rd Gen)
n/a1.0.143.1n/an/a
3.15n/a1.0.147.2131.0.454.205

Note

Last updated: March 19, 2014

User Agent Examples

Below are some example user agent strings for different versions of Kindle Fire.

Silk UA for the Current Kindle Fire and Kindle Fire HD

Desktop

Mozilla/5.0 (Linux; U; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Safari/535.19 Silk-Accelerated=true

Mobile

Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true

Silk UA for Kindle Fire 1st Generation

In the examples below, red fields are variable. As mentioned earlier, the numeric value will increment with software updates, while the Silk-Accelerated value can be either true or false, depending upon customer selection.

Desktop

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.13.81_10003810) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true

Mobile

Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Silk/1.0.13.81_10003810) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 Silk-Accelerated=true

User Agent Detection

You can use JavaScript to detect the Silk user agent across various Kindle Fire device families. Unless you want to provide a unique experience for different Kindle Fire devices, we recommend a general match that will work over time as product models and version numbers change. The following examples illustrate best practices for matching the Silk user agent across Kindle Fire device types.

Note:

  • The tests below also match the user agent string for the PlayStation Vita browser. If this is a concern, you can exclude that browser using the following condition:

    !/Playstation/.test(navigator.userAgent)

To detect Silk

   
    if (/\bSilk\b/.test(navigator.userAgent)) {
        alert("Silk detected!");
    }

        

To detect the Silk version

   
    var match = /\bSilk\/([0-9._-]+)\b/.exec(navigator.userAgent);
    if (match) { 
        alert("Detected Silk version "+match[1]);
    }

        

To detect mobile/desktop preference


    var match = /\bSilk\/(.*\bMobile Safari\b)?/.exec(navigator.userAgent);
    if (match) {
        alert("Detected Silk in mode "+(match[1] ? "Mobile" : "Default (desktop)"));
    }

        

To detect multiple variables at once


    var match = /(?:; ([^;)]+) Build\/.*)?\bSilk\/([0-9._-]+)\b(.*\bMobile Safari\b)?/.exec(navigator.userAgent);
    if (match) {
        alert("Detected Silk version "+match[2]+" on device "+(match[1] || "Kindle Fire")+" in mode "+(match[3] ? "Mobile" : "Default (desktop)"));
    }

        

User Agent Spoofing

User agent spoofing makes it possible to include the Silk user agent string in requests sent from some other client. A website then returns resources as though the request came from the Silk browser. This can be useful for testing and troubleshooting. However, keep in mind that a site may use feature detection that responds differently on different devices or platforms. For example, in response to the HTML5 video canPlayType() method, the behavior of a desktop computer spoofing Silk will differ from that of a Kindle Fire actually running Silk.

There are various tools and techniques available for user agent spoofing. The sections below describe several methods for spoofing Silk.

To Spoof the Silk User Agent without Installing a Plugin

The following instructions apply to Google Chrome, Internet Explorer, and Mozilla Firefox.

  1. Follow the How-To Geek instructions for changing your user agent; use one of the user agents listed in User Agent Examples.

  2. Navigate to http://whatsmyuseragent.com/ and verify that your spoofed user agent is detected.

  3. Navigate to the page on which you want to spoof the user agent.

To Spoof the Silk User Agent in Google Chrome

  1. Install the User-Agent Switcher for Chrome.

  2. Click the new Chrome UA Spoofer icon at the top-right of the Chrome browser.

  3. Click Settings and add one or more of the Silk user agents listed in User Agent Examples. You'll probably want to add these to a "Silk" group with the Indicator Flag "SLK".

  4. Open a new tab and click the Chrome UA Spoofer icon again. Select your new user agent from the appropriate group (presumably "Silk"). The indicator flag (presumably "SLK") that appears over the icon indicates that you're spoofing the Silk user agent.

  5. Navigate to the page on which you want to spoof the user agent.

To Spoof the Silk User Agent in Mozilla Firefox

  1. Install the User Agent Switcher and restart the browser.

  2. In the Firefox browser, go to Tools > Default User Agent > Edit User Agents... and create one or more of the Silk user agents listed at User Agent Examples. When you're finished creating user agents, click OK.

  3. Go to Tools > Default User Agent and select the user agent you want to spoof.

  4. Navigate to http://whatsmyuseragent.com/ and verify that your spoofed user agent is detected.

  5. Navigate to the page on which you want to spoof the user agent.