@excom/detect-browser 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/chunked-rush-logs/detect-browser.apply-exports.chunks.jsonl +1 -0
- package/.rush/temp/chunked-rush-logs/detect-browser.build_docs.chunks.jsonl +1 -0
- package/.rush/temp/chunked-rush-logs/detect-browser.build_package-metas.chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/all.log +1 -0
- package/.rush/temp/operation/apply-exports/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/state.json +3 -0
- package/.rush/temp/operation/build_docs/all.log +1 -0
- package/.rush/temp/operation/build_docs/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/build_docs/state.json +3 -0
- package/.rush/temp/operation/build_package-metas/all.log +1 -0
- package/.rush/temp/operation/build_package-metas/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/build_package-metas/state.json +3 -0
- package/.rush/temp/shrinkwrap-deps.json +3 -0
- package/config/rig.json +5 -0
- package/detect-browser.ts +196 -0
- package/index.ts +17 -0
- package/package.json +42 -0
- package/rush-logs/detect-browser.apply-exports.cache.log +1 -0
- package/rush-logs/detect-browser.apply-exports.log +1 -0
- package/rush-logs/detect-browser.build_docs.cache.log +1 -0
- package/rush-logs/detect-browser.build_docs.log +1 -0
- package/rush-logs/detect-browser.build_package-metas.cache.log +1 -0
- package/rush-logs/detect-browser.build_package-metas.log +1 -0
- package/support/custom-elements.json +327 -0
- package/support/demos/language.html +16 -0
- package/support/demos/safari.html +11 -0
- package/support/demos/simple.html +15 -0
- package/support/dist-docs/detect-browser.md +145 -0
- package/support/docs/README.md +51 -0
- package/support/package-meta.json +146 -0
- package/support/tests/detect-browser.test.ts +413 -0
- package/support/tests/language.view.test.ts +21 -0
- package/support/tests/safari.view.test.ts +29 -0
- package/support/tests/simple.view.test.ts +20 -0
- package/tsconfig.json +5 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<detect-browser>
|
|
3
|
+
<span lang="en">Hello</span>
|
|
4
|
+
<span lang="es">Hola</span>
|
|
5
|
+
</detect-browser>
|
|
6
|
+
<style>
|
|
7
|
+
#demo-detect-browser-language > :first-child {
|
|
8
|
+
detect-browser {
|
|
9
|
+
[lang="en"],
|
|
10
|
+
[lang="es"] { display: none; }
|
|
11
|
+
&[language-id^="es"] [lang="es"],
|
|
12
|
+
&:not([language-id^="es"]) [lang="en"] { display: inline; }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<small role="note">Spoof an iOS Safari user agent in DevTools and reload.</small>
|
|
3
|
+
<detect-browser></detect-browser>
|
|
4
|
+
<quark-sheet>
|
|
5
|
+
@use "/demo-utils" as *;
|
|
6
|
+
|
|
7
|
+
detect-browser[browser-name="safari"] {
|
|
8
|
+
content: loadPolyfills(prop("provision"));
|
|
9
|
+
}
|
|
10
|
+
</quark-sheet>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<detect-browser></detect-browser>
|
|
3
|
+
<style>
|
|
4
|
+
#demo-detect-browser-simple> :first-child {
|
|
5
|
+
detect-browser::before { content: "Rendered with CSS: "; }
|
|
6
|
+
detect-browser::after {
|
|
7
|
+
content:
|
|
8
|
+
"browser: " attr(browser-name) " " attr(browser-version)
|
|
9
|
+
" · engine: " attr(browser-engine)
|
|
10
|
+
" · os: " attr(operating-system)
|
|
11
|
+
" · device: " attr(device-type);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
</style>
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# detect-browser
|
|
2
|
+
|
|
3
|
+
Drop-in tag provides browser, OS, device, and language metadata — target Safari, standalone mode, mobile devices, etc. Helpful in creating device-specific UX.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
```html
|
|
7
|
+
<div>
|
|
8
|
+
<detect-browser></detect-browser>
|
|
9
|
+
<style>
|
|
10
|
+
#demo-detect-browser-simple> :first-child {
|
|
11
|
+
detect-browser::before { content: "Rendered with CSS: "; }
|
|
12
|
+
detect-browser::after {
|
|
13
|
+
content:
|
|
14
|
+
"browser: " attr(browser-name) " " attr(browser-version)
|
|
15
|
+
" · engine: " attr(browser-engine)
|
|
16
|
+
" · os: " attr(operating-system)
|
|
17
|
+
" · device: " attr(device-type);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
21
|
+
</div>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **Attribute metadata** Set once on connect for CSS / Quark targeting
|
|
28
|
+
- **Standalone / PWA detection** `is-standalone` reflects installed mode
|
|
29
|
+
- **Language detection** `language-id` reflects system-selected language
|
|
30
|
+
- **Device class** `device-type` (`mobile` / `desktop`) for coarse targeting
|
|
31
|
+
- **Full metadata** `.provision` exposes user agent, languages, hardware hints
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
`@excom/detect-browser` v0.1.0
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm add @excom/detect-browser
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install @excom/detect-browser
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
yarn add @excom/detect-browser
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Import
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import "@excom/detect-browser";
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
Drop it anywhere and select on its attributes with plain CSS.
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<detect-browser></detect-browser>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```css
|
|
67
|
+
html:has(detect-browser[browser-name="safari"]) .safari-only {
|
|
68
|
+
display: block;
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Live touch / pointer detection is `detect-media media-query="(pointer: coarse)"` — this element reports what the user agent says once, not what the input is now.
|
|
73
|
+
|
|
74
|
+
### API Reference
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
#### Attributes
|
|
78
|
+
|
|
79
|
+
| Name | Surface | Type | Default | Values | Description |
|
|
80
|
+
| --- | --- | --- | --- | --- | --- |
|
|
81
|
+
| `browser-name` | state | `string` | | `"chrome"` \| `"firefox"` \| `"safari"` \| `"edge"` \| `"opera"` \| `internet explorer` | Detected browser family. |
|
|
82
|
+
| `browser-version` | state | `string` | | | Browser version, as reported by the user agent string. |
|
|
83
|
+
| `browser-engine` | state | `string` | | `"blink"` \| `"gecko"` \| `"webkit"` \| `"trident"` | Rendering engine. |
|
|
84
|
+
| `browser-vendor` | state | `string` | | | `navigator.vendor`, lowercased. |
|
|
85
|
+
| `operating-system` | state | `string` | | `windows 10+` \| `windows 8.1` \| `windows 8` \| `windows 7` \| `macos <version>` \| `"android"` \| `"ios"` \| `"linux"` | Detected OS and, where available, version. |
|
|
86
|
+
| `operating-platform` | state | `string` | | | `navigator.userAgentData.platform` (falls back to `navigator.platform`), lowercased. |
|
|
87
|
+
| `device-type` | state | `string` | | `"mobile"` \| `"desktop"` | Coarse device class inferred from the user agent string. |
|
|
88
|
+
| `is-standalone` | state | `boolean` | | | Present when running in standalone / installed PWA mode. |
|
|
89
|
+
| `language-id` | state | `string` | | | `navigator.language`, lowercased. |
|
|
90
|
+
| `cookies-enabled` | state | `boolean` | | | Present when `navigator.cookieEnabled` is `true`. |
|
|
91
|
+
| `do-not-track` | state | `string` | | | `navigator.doNotTrack`, as reported by the browser. |
|
|
92
|
+
|
|
93
|
+
#### Provision
|
|
94
|
+
|
|
95
|
+
| Name | Type | Description |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| `provision` | `BrowserInfo` (`{ browserName: string \| null; browserVersion: string \| null; browserEngine: string \| null; browserVendor: string \| null; operatingSystem: string \| null; operatingPlatform: string \| null; deviceType: string \| null; isStandalone: boolean \| null; languageId: string \| null; cookiesEnabled: boolean \| null; doNotTrack: string \| null; userAgent: string \| null; languageIds: string[] \| null; hardwareConcurrency: number \| null; deviceMemory: number \| null; }`) | Every field above, plus values with no CSS-friendly attribute form: full user agent string, `navigator.languages`, hardware concurrency, and device memory (GB, where supported). Not reflected as an attribute. |
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Examples
|
|
102
|
+
|
|
103
|
+
#### Language
|
|
104
|
+
|
|
105
|
+
Showing a greeting in your system language (Only Spanish or English for this example). `language-id` mirrors `navigator.language` (lowercased). Spanish prefixes show `Hola`; everything else shows `Hello`. Change the browser language (or override it in DevTools) and reload to flip it.
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
```html
|
|
109
|
+
<div>
|
|
110
|
+
<detect-browser>
|
|
111
|
+
<span lang="en">Hello</span>
|
|
112
|
+
<span lang="es">Hola</span>
|
|
113
|
+
</detect-browser>
|
|
114
|
+
<style>
|
|
115
|
+
#demo-detect-browser-language > :first-child {
|
|
116
|
+
detect-browser {
|
|
117
|
+
[lang="en"],
|
|
118
|
+
[lang="es"] { display: none; }
|
|
119
|
+
&[language-id^="es"] [lang="es"],
|
|
120
|
+
&:not([language-id^="es"]) [lang="en"] { display: inline; }
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
124
|
+
</div>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
#### Loading platform-specific polyfills
|
|
129
|
+
|
|
130
|
+
In this demo, when the browser is Safari, polyfills are loaded. Spoof an iOS Safari user agent in DevTools and reload to trigger it. It will also `console.log` the full device info.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<div>
|
|
135
|
+
<small role="note">Spoof an iOS Safari user agent in DevTools and reload.</small>
|
|
136
|
+
<detect-browser></detect-browser>
|
|
137
|
+
<quark-sheet>
|
|
138
|
+
@use "/demo-utils" as *;
|
|
139
|
+
|
|
140
|
+
detect-browser[browser-name="safari"] {
|
|
141
|
+
content: loadPolyfills(prop("provision"));
|
|
142
|
+
}
|
|
143
|
+
</quark-sheet>
|
|
144
|
+
</div>
|
|
145
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# detect-browser
|
|
2
|
+
|
|
3
|
+
Drop-in tag provides browser, OS, device, and language metadata — target Safari, standalone mode, mobile devices, etc. Helpful in creating device-specific UX.
|
|
4
|
+
|
|
5
|
+
<include-content data-demo="simple"></include-content>
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Attribute metadata** Set once on connect for CSS / Quark targeting
|
|
10
|
+
- **Standalone / PWA detection** `is-standalone` reflects installed mode
|
|
11
|
+
- **Language detection** `language-id` reflects system-selected language
|
|
12
|
+
- **Device class** `device-type` (`mobile` / `desktop`) for coarse targeting
|
|
13
|
+
- **Full metadata** `.provision` exposes user agent, languages, hardware hints
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
<include-content is-active template-ref="/views/install-section/install-section.html"></include-content>
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Drop it anywhere and select on its attributes with plain CSS.
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<detect-browser></detect-browser>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```css
|
|
28
|
+
html:has(detect-browser[browser-name="safari"]) .safari-only {
|
|
29
|
+
display: block;
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Live touch / pointer detection is `detect-media media-query="(pointer: coarse)"` — this element reports what the user agent says once, not what the input is now.
|
|
34
|
+
|
|
35
|
+
### API Reference
|
|
36
|
+
|
|
37
|
+
<include-content is-active template-ref="/views/api-reference/api-reference.html"></include-content>
|
|
38
|
+
|
|
39
|
+
### Examples
|
|
40
|
+
|
|
41
|
+
#### Language
|
|
42
|
+
|
|
43
|
+
Showing a greeting in your system language (Only Spanish or English for this example). `language-id` mirrors `navigator.language` (lowercased). Spanish prefixes show `Hola`; everything else shows `Hello`. Change the browser language (or override it in DevTools) and reload to flip it.
|
|
44
|
+
|
|
45
|
+
<include-content data-demo="language"></include-content>
|
|
46
|
+
|
|
47
|
+
#### Loading platform-specific polyfills
|
|
48
|
+
|
|
49
|
+
In this demo, when the browser is Safari, polyfills are loaded. Spoof an iOS Safari user agent in DevTools and reload to trigger it. It will also `console.log` the full device info.
|
|
50
|
+
|
|
51
|
+
<include-content data-demo="safari"></include-content>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"shortName": "detect-browser",
|
|
3
|
+
"package": {
|
|
4
|
+
"name": "@excom/detect-browser",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "<detect-browser> custom element",
|
|
7
|
+
"peerDependencies": {},
|
|
8
|
+
"excom": {
|
|
9
|
+
"packageType": "kit-element"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"demos": {
|
|
13
|
+
"language": "<div>\n <detect-browser>\n <span lang=\"en\">Hello</span>\n <span lang=\"es\">Hola</span>\n </detect-browser>\n <style>\n #demo-detect-browser-language > :first-child {\n detect-browser {\n [lang=\"en\"],\n [lang=\"es\"] { display: none; }\n &[language-id^=\"es\"] [lang=\"es\"],\n &:not([language-id^=\"es\"]) [lang=\"en\"] { display: inline; }\n }\n }\n </style>\n</div>\n",
|
|
14
|
+
"safari": "<div>\n <small role=\"note\">Spoof an iOS Safari user agent in DevTools and reload.</small>\n <detect-browser></detect-browser>\n <quark-sheet>\n @use \"/demo-utils\" as *;\n\n detect-browser[browser-name=\"safari\"] {\n content: loadPolyfills(prop(\"provision\"));\n }\n </quark-sheet>\n</div>\n",
|
|
15
|
+
"simple": "<div>\n <detect-browser></detect-browser>\n <style>\n #demo-detect-browser-simple> :first-child {\n detect-browser::before { content: \"Rendered with CSS: \"; }\n detect-browser::after {\n content:\n \"browser: \" attr(browser-name) \" \" attr(browser-version)\n \" · engine: \" attr(browser-engine)\n \" · os: \" attr(operating-system)\n \" · device: \" attr(device-type);\n }\n }\n </style>\n</div>"
|
|
16
|
+
},
|
|
17
|
+
"readme": "<h1 id=\"md-detect-browser\">detect-browser</h1>\n<p>Drop-in tag provides browser, OS, device, and language metadata — target Safari, standalone mode, mobile devices, etc. Helpful in creating device-specific UX.</p>\n<p><include-content data-demo=\"simple\"></include-content></p>\n<h2 id=\"md-features\">Features</h2>\n<ul>\n<li><strong>Attribute metadata</strong> Set once on connect for CSS / Quark targeting</li>\n<li><strong>Standalone / PWA detection</strong> <code>is-standalone</code> reflects installed mode</li>\n<li><strong>Language detection</strong> <code>language-id</code> reflects system-selected language</li>\n<li><strong>Device class</strong> <code>device-type</code> (<code>mobile</code> / <code>desktop</code>) for coarse targeting</li>\n<li><strong>Full metadata</strong> <code>.provision</code> exposes user agent, languages, hardware hints</li>\n</ul>\n<h2 id=\"md-installation\">Installation</h2>\n<p><include-content is-active template-ref=\"/views/install-section/install-section.html\"></include-content></p>\n<h2 id=\"md-usage\">Usage</h2>\n<p>Drop it anywhere and select on its attributes with plain CSS.</p>\n<include-content data-language=\"html\"><template><detect-browser></detect-browser></template></include-content>\n<include-content data-language=\"css\"><template>html:has(detect-browser[browser-name=\"safari\"]) .safari-only {\n display: block;\n}</template></include-content>\n<p>Live touch / pointer detection is <code>detect-media media-query="(pointer: coarse)"</code> — this element reports what the user agent says once, not what the input is now.</p>\n<h3 id=\"md-api-reference\">API Reference</h3>\n<p><include-content is-active template-ref=\"/views/api-reference/api-reference.html\"></include-content></p>\n<h3 id=\"md-examples\">Examples</h3>\n<h4 id=\"md-language\">Language</h4>\n<p>Showing a greeting in your system language (Only Spanish or English for this example). <code>language-id</code> mirrors <code>navigator.language</code> (lowercased). Spanish prefixes show <code>Hola</code>; everything else shows <code>Hello</code>. Change the browser language (or override it in DevTools) and reload to flip it.</p>\n<p><include-content data-demo=\"language\"></include-content></p>\n<h4 id=\"md-loading-platform-specific-polyfills\">Loading platform-specific polyfills</h4>\n<p>In this demo, when the browser is Safari, polyfills are loaded. Spoof an iOS Safari user agent in DevTools and reload to trigger it. It will also <code>console.log</code> the full device info.</p>\n<p><include-content data-demo=\"safari\"></include-content></p>\n",
|
|
18
|
+
"docs": {
|
|
19
|
+
"readme": "<h1 id=\"md-detect-browser\">detect-browser</h1>\n<p>Drop-in tag provides browser, OS, device, and language metadata — target Safari, standalone mode, mobile devices, etc. Helpful in creating device-specific UX.</p>\n<p><include-content data-demo=\"simple\"></include-content></p>\n<h2 id=\"md-features\">Features</h2>\n<ul>\n<li><strong>Attribute metadata</strong> Set once on connect for CSS / Quark targeting</li>\n<li><strong>Standalone / PWA detection</strong> <code>is-standalone</code> reflects installed mode</li>\n<li><strong>Language detection</strong> <code>language-id</code> reflects system-selected language</li>\n<li><strong>Device class</strong> <code>device-type</code> (<code>mobile</code> / <code>desktop</code>) for coarse targeting</li>\n<li><strong>Full metadata</strong> <code>.provision</code> exposes user agent, languages, hardware hints</li>\n</ul>\n<h2 id=\"md-installation\">Installation</h2>\n<p><include-content is-active template-ref=\"/views/install-section/install-section.html\"></include-content></p>\n<h2 id=\"md-usage\">Usage</h2>\n<p>Drop it anywhere and select on its attributes with plain CSS.</p>\n<include-content data-language=\"html\"><template><detect-browser></detect-browser></template></include-content>\n<include-content data-language=\"css\"><template>html:has(detect-browser[browser-name=\"safari\"]) .safari-only {\n display: block;\n}</template></include-content>\n<p>Live touch / pointer detection is <code>detect-media media-query="(pointer: coarse)"</code> — this element reports what the user agent says once, not what the input is now.</p>\n<h3 id=\"md-api-reference\">API Reference</h3>\n<p><include-content is-active template-ref=\"/views/api-reference/api-reference.html\"></include-content></p>\n<h3 id=\"md-examples\">Examples</h3>\n<h4 id=\"md-language\">Language</h4>\n<p>Showing a greeting in your system language (Only Spanish or English for this example). <code>language-id</code> mirrors <code>navigator.language</code> (lowercased). Spanish prefixes show <code>Hola</code>; everything else shows <code>Hello</code>. Change the browser language (or override it in DevTools) and reload to flip it.</p>\n<p><include-content data-demo=\"language\"></include-content></p>\n<h4 id=\"md-loading-platform-specific-polyfills\">Loading platform-specific polyfills</h4>\n<p>In this demo, when the browser is Safari, polyfills are loaded. Spoof an iOS Safari user agent in DevTools and reload to trigger it. It will also <code>console.log</code> the full device info.</p>\n<p><include-content data-demo=\"safari\"></include-content></p>\n"
|
|
20
|
+
},
|
|
21
|
+
"installation": {
|
|
22
|
+
"name": "@excom/detect-browser",
|
|
23
|
+
"shortName": "detect-browser",
|
|
24
|
+
"version": "0.1.0",
|
|
25
|
+
"description": "<detect-browser> custom element",
|
|
26
|
+
"packageType": "kit-element",
|
|
27
|
+
"cdn": "<script src=\"https://unpkg.com/@excom/kit-utils/dist/index.umd.min.js\"></script>\n<script src=\"https://unpkg.com/@excom/neutron/dist/index.umd.min.js\"></script>\n<script src=\"https://unpkg.com/@excom/detect-browser@0.1.0/dist/index.umd.min.js\"></script>",
|
|
28
|
+
"install": {
|
|
29
|
+
"npm": "npm install @excom/detect-browser"
|
|
30
|
+
},
|
|
31
|
+
"imports": {
|
|
32
|
+
"js": "import \"@excom/detect-browser\";",
|
|
33
|
+
"html": "<!-- import path to `node_modules` will depend on your build setup -->\n<script type=\"module\" src=\"/node_modules/@excom/detect-browser\"></script>\n<link rel=\"stylesheet\" href=\"/node_modules/@excom/detect-browser\">"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": []
|
|
36
|
+
},
|
|
37
|
+
"elementApis": [
|
|
38
|
+
{
|
|
39
|
+
"tag": "detect-browser",
|
|
40
|
+
"summary": "CSS-selectable browser, OS, and device metadata.",
|
|
41
|
+
"kind": "class",
|
|
42
|
+
"attributes": [
|
|
43
|
+
{
|
|
44
|
+
"name": "browser-engine",
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "Rendering engine.",
|
|
47
|
+
"fieldName": "browserEngine",
|
|
48
|
+
"surface": "state",
|
|
49
|
+
"values": "\"blink\" | \"gecko\" | \"webkit\" | \"trident\""
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "browser-name",
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "Detected browser family.",
|
|
55
|
+
"fieldName": "browserName",
|
|
56
|
+
"surface": "state",
|
|
57
|
+
"values": "\"chrome\" | \"firefox\" | \"safari\" | \"edge\" | \"opera\" | internet explorer"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "browser-vendor",
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "<code>navigator.vendor</code>, lowercased.",
|
|
63
|
+
"fieldName": "browserVendor",
|
|
64
|
+
"surface": "state"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "browser-version",
|
|
68
|
+
"type": "string",
|
|
69
|
+
"description": "Browser version, as reported by the user agent string.",
|
|
70
|
+
"fieldName": "browserVersion",
|
|
71
|
+
"surface": "state"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "cookies-enabled",
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"description": "Present when <code>navigator.cookieEnabled</code> is <code>true</code>.",
|
|
77
|
+
"fieldName": "cookiesEnabled",
|
|
78
|
+
"surface": "state"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "device-type",
|
|
82
|
+
"type": "string",
|
|
83
|
+
"description": "Coarse device class inferred from the user agent string.",
|
|
84
|
+
"fieldName": "deviceType",
|
|
85
|
+
"surface": "state",
|
|
86
|
+
"values": "\"mobile\" | \"desktop\""
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "do-not-track",
|
|
90
|
+
"type": "string",
|
|
91
|
+
"description": "<code>navigator.doNotTrack</code>, as reported by the browser.",
|
|
92
|
+
"fieldName": "doNotTrack",
|
|
93
|
+
"surface": "state"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "is-standalone",
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"description": "Present when running in standalone / installed PWA mode.",
|
|
99
|
+
"fieldName": "isStandalone",
|
|
100
|
+
"surface": "state"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "language-id",
|
|
104
|
+
"type": "string",
|
|
105
|
+
"description": "<code>navigator.language</code>, lowercased.",
|
|
106
|
+
"fieldName": "languageId",
|
|
107
|
+
"surface": "state"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "operating-platform",
|
|
111
|
+
"type": "string",
|
|
112
|
+
"description": "<code>navigator.userAgentData.platform</code> (falls back to <code>navigator.platform</code>), lowercased.",
|
|
113
|
+
"fieldName": "operatingPlatform",
|
|
114
|
+
"surface": "state"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "operating-system",
|
|
118
|
+
"type": "string",
|
|
119
|
+
"description": "Detected OS and, where available, version.",
|
|
120
|
+
"fieldName": "operatingSystem",
|
|
121
|
+
"surface": "state",
|
|
122
|
+
"values": "windows 10+ | windows 8.1 | windows 8 | windows 7 | macos <version> | \"android\" | \"ios\" | \"linux\""
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"events": [],
|
|
126
|
+
"slots": [],
|
|
127
|
+
"cssProperties": [],
|
|
128
|
+
"cssClasses": [],
|
|
129
|
+
"cssAliases": [],
|
|
130
|
+
"listens": [],
|
|
131
|
+
"commands": [],
|
|
132
|
+
"defaultActions": [],
|
|
133
|
+
"expectedChildren": [],
|
|
134
|
+
"provisions": [
|
|
135
|
+
{
|
|
136
|
+
"name": "provision",
|
|
137
|
+
"type": "BrowserInfo",
|
|
138
|
+
"typeExpanded": "{ browserName: string | null; browserVersion: string | null; browserEngine: string | null; browserVendor: string | null; operatingSystem: string | null; operatingPlatform: string | null; deviceType: string | null; isStandalone: boolean | null; languageId: string | null; cookiesEnabled: boolean | null; doNotTrack: string | null; userAgent: string | null; languageIds: string[] | null; hardwareConcurrency: number | null; deviceMemory: number | null; }",
|
|
139
|
+
"description": "Every field above, plus values with no CSS-friendly attribute form: full user agent string, <code>navigator.languages</code>, hardware concurrency, and device memory (GB, where supported). Not reflected as an attribute.",
|
|
140
|
+
"fieldName": "provision"
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"exportedFiles": {}
|
|
146
|
+
}
|