The RFC all implementations can follow to facilitate porting.
This is the top-level content in the report. This is an array of Report.
Example:
[
{
"url": "https:\/\/example.com\/",
"durationInSeconds": 0.48,
"scores": {
"seo": 100,
"security": 50,
"performance": 100,
"accessibility": 61
},
"seo": [
{
"name": "titlePresent",
"passes": true
},
{
"name": "langPresent",
"passes": true,
}
],
"security": [
{
"name": "serverHeaderHidden",
"passes": false
},
{
"name:" "xFrameOptionHeaderPresent",
"passes": true
}
],
"performance": [
{
"name": "textCompressionEnabled",
"passes": true
},
{
"name": "fastResponseTime",
"passes": true,
}
],
"accessibility": [
{
"name": "metaViewportPresent",
"passes": true,
},
{
"name:" "useLandmarkTags",
"passes": true
},
{
"name": "buttonsAndLinksHaveAccessibleName",
"passes": false,
"items": [
{
"identifier": "<button id=\"login\"></button>"
},
{
"identifier": "<a class=\"fa fas-home\"></a>"
}
]
}
]
}
]
A report is the summary of the analysis for a single page.
interface Report {
url: string,
durationInSeconds: number,
scores: Score,
seo: RuleResult[],
security: RuleResult[]
}
Example:
{
"url": "https:\/\/example.com\/",
"durationInSeconds": 0.48,
"scores": {
"seo": 100,
"security": 50,
"performance": 100,
"accessibility": 61
},
"seo": [
{
"name": "titlePresent",
"passes": true
},
{
"name": "langPresent",
"passes": true,
}
],
"security": [
{
"name": "serverHeaderHidden",
"passes": false
},
{
"name:" "xFrameOptionHeaderPresent",
"passes": true
}
],
"performance": [
{
"name": "textCompressionEnabled",
"passes": true
},
{
"name": "fastResponseTime",
"passes": true,
}
],
"accessibility": [
{
"name": "metaViewportPresent",
"passes": true,
},
{
"name:" "useLandmarkTags",
"passes": true
},
{
"name": "buttonsAndLinksHaveAccessibleName",
"passes": false,
"items": [
{
"identifier": "<button id=\"login\"></button>"
},
{
"identifier": "<a class=\"fa fas-home\"></a>"
}
]
}
]
}
Represents all the audits scores.
interface Score {
seo: number,
security: number,
performance: number,
accessibility: number
}
Example:
{
"seo": 100,
"security": 75,
"performance": 100,
"accessibility": 61
}
Represents a rule and its result.
interface RuleResult {
name: string,
passes: boolean,
items?: Item[]
}
Represents an item that failed to pass a rule.
interface Item {
identifier: string,
error?: string
}
Example:
{
"identifier": "<div id=\"item-12\"></div>",
"error": "Duplicated with <div id=\"item-12\" class=\"bg-warning d-none\"></div>"
}
Lightship implementations should be able to parse a configuration file to run the web crawler as an alternative to a code-driven execution.
The default name cli-tools can seek for should be "lightship.json".
interface Configuration {
domains: Domain[],
routes: Route[]
}
Example:
{
"domains": [
{
"base": "https://example.com",
"routes": [
{
"path": "/"
},
{
"path": "/register"
}
]
}
],
"routes": [
{
"path": "https://news.google.com/topstories"
}
]
}
Represent a base path to easily specify all the routes that share the same domain.
interface Domain {
base: string,
routes: Route[]
}
Example:
{
"base": "https://example.com",
"routes": [
{
"path": "/",
},
{
"path": "/register",
"queries": [
{
"key": "utm-source",
"value": "mailing"
}
]
}
]
}
The route represents either a relative path to a domain, or an absolute path (with the base).
interface Route {
path: string,
queries?: Query[]
}
Example:
{
"path": "/account",
"queries": [
{
"key": "theme",
"value": "dark"
}
]
}
Represent a query string.
interface Query {
key: string,
value: string
}
Example:
{
"key": "lang",
"value": "en"
}
The list of rules classified by category.
Passes if the HTML title tag is present and filled.
Value: 25
Passes if the lang attribute on the HTML html tag is present and filled.
Value: 25
Passes if all "a" tags define a "href" attribute.
Value: 25
Passes if a <meta name="description" />
tag is present.
Value: 25
3.2.1. Server header hidden
Passes if the "Server" header is not present or empty.
Value: 25
Passes if the "Strict-Transport-Security" header is present and have a valid value.
Value: 25
Passes if the "X-Frame-Options" header is present and have a valid value.
Value: 25
3.2.4. X-Powered-By header hidden
Passes if the "X-Powered-By" header is not present or empty.
Value: 25
Passes if the "content-encoding" header is present and defines one of "br", "gzip" or "deflate" decompressions.
Value: 25
Passes if the response time is under a second.
Value: 25
Passes if the response was not hidden behind a redirection.
Value: 25
Passes if the response was served through HTTP/2.
Value: 25
Passes if the <meta name="viewport" />
is present and has a valid value (either "width" or "initial-scale").
Value: 14
Passes if the response contains either "main", "header", "nav", or "footer" tag elements.
Value: 14
Passes if all buttons and "a" tags have a text or define an "aria-label" attribute.
Value: 15
Passes if no duplicate "id" attribute is found.
Value: 15
Passes if all images have an "alt" attribute.
Value: 14
Passes if the "<!DOCTYPE html>" declaration is present.
Value: 14
Passes if the content contains a <meta name="theme-color" />
.
Value: 14