Resource: Engines Database

Thomas Müller edited this page May 8, 2015 · 5 revisions

Rendering Engine Expansion

The rendering engines database is designed to reduce repetition within the User Agent files. When running a build, the engine "expansion" takes place. Unlike the Platform Expansion there is no replacement of any placeholders.

For example, if you had the following engines database:

{
  "engines": {
    "Engine1": {
      "properties": {
        "RenderingEngine_Name": "WebKit",
        "RenderingEngine_Version": "unknown"
      }
    },
    "Engine2": {
      "inherits": "Engine1",
      "properties": {
        "RenderingEngine_Version": "2.0"
      }
    }
  }
}

You could then use the Engine1 and Engine2 identifiers in the engine definition in the UA JSON file:

{
  "division": "Division",
  "sortIndex": 100,
  "userAgents": [
    {
      "userAgent": "UA",
      "engine": "Engine1",
      "properties": {
        "Parent": "DefaultProperties",
        "Comment": "UA",
        "Browser": "UA"
      },
      "children": {
        "match": "UA String (*)",
        "engine": "Engine2"
      }
    }
  ]
}

In the generated INI file, this would generate 3 sections:

[UA]
Parent=DefaultProperties
Comment=UA
Browser=UA
RenderingEngine_Name="WebKit",
RenderingEngine_Version="unknown"

[UA String (*Platform 1*)]
Parent=UA
RenderingEngine_Version="2.0"

Note that any properties in the engine definition are copied across into the child sections in the INI file (in the example, the RenderingEngine_Version field).

Engine Definition

The definition for a engine should look like the following JSON object:

{
  /* Engine Identifier */: {
    "inherits": /* optional Parent Identifier */,
    "properties": {
      /* Properties for expansion */
    }
  }
}

Engine Property Definition

For engine information we have the following properties.

RenderingEngine_Name

This is the Name of the Engine.

RenderingEngine_Version

This is the version of the engine. For some engines (e.g. WebKit, Blink) we dont detect the version, because this would blow up the size of the browscap.* files too much.

RenderingEngine_Description

A description about the engine and where the engine is used.

RenderingEngine_Maker

The Company/Organisation which created or maintained the engine.

BackgroundSounds

This property is set to true if the engine supports the bgsound HTML element/attribute. This property should only be true for Trident. This property should be seen as deprecated.

VBScript

This property is set to true if the engine supports VB Script. This property should only be true for Trident. This property should be seen as deprecated.

JavaApplets

This property is set to true if the engine supports the applet HTML element. This property should only be true for Trident, Gecko and WebKit (Safari), but not for Chrome and Opera. The applet HTML element is deprecated for HTML5. This property should be seen as deprecated.

ActiveXControls

This property is set to true if the engine supports Active X. This property should only be true for Trident. This property should be seen as deprecated.