@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 @@
|
|
|
1
|
+
{"kind":"O","text":"Invoking: cd \"$RUSH_PROJECT_FOLDER\" && node ../heft-rig/scripts/apply-exports.mjs \n"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"O","text":"Invoking: node node_modules/@excom/heft-rig/scripts/build-docs.mjs \n"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"O","text":"Invoking: node node_modules/@excom/heft-rig/scripts/build-package-metas.mjs \n"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Invoking: cd "$RUSH_PROJECT_FOLDER" && node ../heft-rig/scripts/apply-exports.mjs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"O","text":"Invoking: cd \"$RUSH_PROJECT_FOLDER\" && node ../heft-rig/scripts/apply-exports.mjs \n"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Invoking: node node_modules/@excom/heft-rig/scripts/build-docs.mjs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"O","text":"Invoking: node node_modules/@excom/heft-rig/scripts/build-docs.mjs \n"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Invoking: node node_modules/@excom/heft-rig/scripts/build-package-metas.mjs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"O","text":"Invoking: node node_modules/@excom/heft-rig/scripts/build-package-metas.mjs \n"}
|
package/config/rig.json
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { ConstructorType, Neutron } from "@excom/neutron";
|
|
2
|
+
|
|
3
|
+
export type BrowserInfo = {
|
|
4
|
+
browserName: string | null;
|
|
5
|
+
browserVersion: string | null;
|
|
6
|
+
browserEngine: string | null;
|
|
7
|
+
browserVendor: string | null;
|
|
8
|
+
operatingSystem: string | null;
|
|
9
|
+
operatingPlatform: string | null;
|
|
10
|
+
deviceType: string | null;
|
|
11
|
+
isStandalone: boolean | null;
|
|
12
|
+
languageId: string | null;
|
|
13
|
+
cookiesEnabled: boolean | null;
|
|
14
|
+
doNotTrack: string | null;
|
|
15
|
+
userAgent: string | null;
|
|
16
|
+
languageIds: string[] | null;
|
|
17
|
+
hardwareConcurrency: number | null;
|
|
18
|
+
deviceMemory: number | null;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Zero-JS browser / OS / device metadata provider. Sets attributes once on
|
|
23
|
+
* connect so plain CSS can target Safari, iOS, standalone (installed PWA)
|
|
24
|
+
* mode, and more — no app JavaScript required. Values with
|
|
25
|
+
* no CSS-friendly attribute form (full user agent, language list, hardware
|
|
26
|
+
* hints) live on the `.provision` property instead.
|
|
27
|
+
*
|
|
28
|
+
* @summary CSS-selectable browser, OS, and device metadata.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* <detect-browser></detect-browser>
|
|
32
|
+
* <!-- html:has(detect-browser[browser-name="safari"]) { ... } -->
|
|
33
|
+
*/
|
|
34
|
+
export const DetectBrowser = Neutron({
|
|
35
|
+
tag: "detect-browser",
|
|
36
|
+
props: {
|
|
37
|
+
/**
|
|
38
|
+
* @state
|
|
39
|
+
* Detected browser family.
|
|
40
|
+
* @values chrome | firefox | safari | edge | opera | internet explorer
|
|
41
|
+
*/
|
|
42
|
+
browserName: String,
|
|
43
|
+
/**
|
|
44
|
+
* @state
|
|
45
|
+
* Browser version, as reported by the user agent string.
|
|
46
|
+
*/
|
|
47
|
+
browserVersion: String,
|
|
48
|
+
/**
|
|
49
|
+
* @state
|
|
50
|
+
* Rendering engine.
|
|
51
|
+
* @values blink | gecko | webkit | trident
|
|
52
|
+
*/
|
|
53
|
+
browserEngine: String,
|
|
54
|
+
/**
|
|
55
|
+
* @state
|
|
56
|
+
* `navigator.vendor`, lowercased.
|
|
57
|
+
*/
|
|
58
|
+
browserVendor: String,
|
|
59
|
+
/**
|
|
60
|
+
* @state
|
|
61
|
+
* Detected OS and, where available, version.
|
|
62
|
+
* @values windows 10+ | windows 8.1 | windows 8 | windows 7 | macos <version> | android | ios | linux
|
|
63
|
+
*/
|
|
64
|
+
operatingSystem: String,
|
|
65
|
+
/**
|
|
66
|
+
* @state
|
|
67
|
+
* `navigator.userAgentData.platform` (falls back to
|
|
68
|
+
* `navigator.platform`), lowercased.
|
|
69
|
+
*/
|
|
70
|
+
operatingPlatform: String,
|
|
71
|
+
/**
|
|
72
|
+
* @state
|
|
73
|
+
* Coarse device class inferred from the user agent string.
|
|
74
|
+
* @values mobile | desktop
|
|
75
|
+
*/
|
|
76
|
+
deviceType: String,
|
|
77
|
+
/**
|
|
78
|
+
* @state
|
|
79
|
+
* Present when running in standalone / installed PWA mode.
|
|
80
|
+
*/
|
|
81
|
+
isStandalone: Boolean,
|
|
82
|
+
/**
|
|
83
|
+
* @state
|
|
84
|
+
* `navigator.language`, lowercased.
|
|
85
|
+
*/
|
|
86
|
+
languageId: String,
|
|
87
|
+
/**
|
|
88
|
+
* @state
|
|
89
|
+
* Present when `navigator.cookieEnabled` is `true`.
|
|
90
|
+
*/
|
|
91
|
+
cookiesEnabled: Boolean,
|
|
92
|
+
/**
|
|
93
|
+
* @state
|
|
94
|
+
* `navigator.doNotTrack`, as reported by the browser.
|
|
95
|
+
*/
|
|
96
|
+
doNotTrack: String,
|
|
97
|
+
/**
|
|
98
|
+
* @provision
|
|
99
|
+
* Every field above, plus values with no CSS-friendly attribute
|
|
100
|
+
* form: full user agent string, `navigator.languages`, hardware
|
|
101
|
+
* concurrency, and device memory (GB, where supported).
|
|
102
|
+
* Not reflected as an attribute.
|
|
103
|
+
* @type BrowserInfo
|
|
104
|
+
*/
|
|
105
|
+
provision: Object as unknown as ConstructorType<BrowserInfo>,
|
|
106
|
+
},
|
|
107
|
+
})
|
|
108
|
+
.defineMethods({
|
|
109
|
+
setBrowserInfo: () => {
|
|
110
|
+
const nav = navigator;
|
|
111
|
+
const ua = nav.userAgent || "";
|
|
112
|
+
const platform = nav.userAgentData?.platform || nav.platform || undefined;
|
|
113
|
+
|
|
114
|
+
// --- Browser name and version ---
|
|
115
|
+
let name: string | undefined, version: string | undefined;
|
|
116
|
+
if (/edg/i.test(ua)) {
|
|
117
|
+
name = "Edge";
|
|
118
|
+
version = ua.match(/edg\/([\d\.]+)/i)?.[1];
|
|
119
|
+
} else if (/chrome|crios/i.test(ua)) {
|
|
120
|
+
name = "Chrome";
|
|
121
|
+
version = ua.match(/(?:chrome|crios)\/([\d\.]+)/i)?.[1];
|
|
122
|
+
} else if (/firefox|fxios/i.test(ua)) {
|
|
123
|
+
name = "Firefox";
|
|
124
|
+
version = ua.match(/(?:firefox|fxios)\/([\d\.]+)/i)?.[1];
|
|
125
|
+
} else if (/safari/i.test(ua) && !/chrome|crios|android/i.test(ua)) {
|
|
126
|
+
name = "Safari";
|
|
127
|
+
version = ua.match(/version\/([\d\.]+)/i)?.[1];
|
|
128
|
+
} else if (/opr|opera/i.test(ua)) {
|
|
129
|
+
name = "Opera";
|
|
130
|
+
version = ua.match(/(?:opera|opr)\/([\d\.]+)/i)?.[1];
|
|
131
|
+
} else if (/msie|trident/i.test(ua)) {
|
|
132
|
+
name = "Internet Explorer";
|
|
133
|
+
version = ua.match(/(?:msie |rv:)([\d\.]+)/i)?.[1];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// --- Engine detection ---
|
|
137
|
+
let engine: string | undefined;
|
|
138
|
+
if (/applewebkit/i.test(ua)) engine = "WebKit";
|
|
139
|
+
if (/chrome|edg|opr/i.test(ua)) engine = "Blink";
|
|
140
|
+
if (/gecko\//i.test(ua) && !/webkit/i.test(ua)) engine = "Gecko";
|
|
141
|
+
if (/trident/i.test(ua)) engine = "Trident";
|
|
142
|
+
|
|
143
|
+
// --- OS detection ---
|
|
144
|
+
let os: string | undefined;
|
|
145
|
+
if (/windows nt 10/i.test(ua)) os = "Windows 10+";
|
|
146
|
+
else if (/windows nt 6\.3/i.test(ua)) os = "Windows 8.1";
|
|
147
|
+
else if (/windows nt 6\.2/i.test(ua)) os = "Windows 8";
|
|
148
|
+
else if (/windows nt 6\.1/i.test(ua)) os = "Windows 7";
|
|
149
|
+
else if (/mac os x (\d+[\._]\d+)/i.test(ua))
|
|
150
|
+
os =
|
|
151
|
+
"macOS " + ua.match(/mac os x (\d+[\._]\d+)/i)?.[1].replace("_", ".");
|
|
152
|
+
else if (/android/i.test(ua)) os = "Android";
|
|
153
|
+
else if (/iphone|ipad|ipod/i.test(ua)) os = "iOS";
|
|
154
|
+
else if (/linux/i.test(ua)) os = "Linux";
|
|
155
|
+
|
|
156
|
+
// --- Device type ---
|
|
157
|
+
const isMobile = /mobi|android|iphone|ipad|ipod/i.test(ua);
|
|
158
|
+
const deviceType = isMobile ? "Mobile" : "Desktop";
|
|
159
|
+
const browserInfo = {
|
|
160
|
+
browserName: name?.toLowerCase() || null,
|
|
161
|
+
browserVersion: version?.toLowerCase() || null,
|
|
162
|
+
browserEngine: engine?.toLowerCase() || null,
|
|
163
|
+
browserVendor: nav.vendor?.toLowerCase() || null,
|
|
164
|
+
operatingSystem: os?.toLowerCase() || null,
|
|
165
|
+
operatingPlatform: platform?.toLowerCase() || null,
|
|
166
|
+
deviceType: deviceType?.toLowerCase() || null,
|
|
167
|
+
isStandalone:
|
|
168
|
+
window.matchMedia("(display-mode: standalone)").matches ||
|
|
169
|
+
// ...for safari...
|
|
170
|
+
nav.standalone ||
|
|
171
|
+
null,
|
|
172
|
+
languageId: nav.language?.toLowerCase() || null,
|
|
173
|
+
cookiesEnabled: nav.cookieEnabled ?? null,
|
|
174
|
+
doNotTrack: nav.doNotTrack ?? null,
|
|
175
|
+
};
|
|
176
|
+
return {
|
|
177
|
+
...browserInfo,
|
|
178
|
+
provision: {
|
|
179
|
+
...browserInfo,
|
|
180
|
+
userAgent: ua || null,
|
|
181
|
+
languageIds: nav.languages || null,
|
|
182
|
+
hardwareConcurrency: nav.hardwareConcurrency || null,
|
|
183
|
+
deviceMemory: nav.deviceMemory ?? null,
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
})
|
|
188
|
+
.onConnected(
|
|
189
|
+
// Skip if we already ran this on a previous connection
|
|
190
|
+
({ wasMounted }) => {
|
|
191
|
+
if (wasMounted) return;
|
|
192
|
+
return {
|
|
193
|
+
setBrowserInfo: [],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
);
|
package/index.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DetectBrowser } from "./detect-browser";
|
|
2
|
+
|
|
3
|
+
DetectBrowser.define();
|
|
4
|
+
|
|
5
|
+
export { DetectBrowser };
|
|
6
|
+
|
|
7
|
+
type T_HTMLDetectBrowserElement = typeof DetectBrowser.CustomElement;
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLDetectBrowserElement extends T_HTMLDetectBrowserElement {}
|
|
10
|
+
interface Window {
|
|
11
|
+
HTMLDetectBrowserElement: HTMLDetectBrowserElement;
|
|
12
|
+
}
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
"detect-browser": HTMLDetectBrowserElement;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export type { HTMLDetectBrowserElement };
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@excom/detect-browser",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "<detect-browser> custom element",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=24.13.0"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@excom/neutron": "^0.1.0"
|
|
12
|
+
},
|
|
13
|
+
"peerDependencies": {},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@excom/heft-rig": "^0.1.0"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"url": "excom-dev/nucleus",
|
|
19
|
+
"directory": "packages/detect-browser"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/excom-dev/nucleus/tree/main/packages/detect-browser/support/docs/README.md",
|
|
22
|
+
"bugs": "https://github.com/excom-dev/nucleus/issues",
|
|
23
|
+
"keywords": [
|
|
24
|
+
"detect-browser",
|
|
25
|
+
"neutron",
|
|
26
|
+
"custom-elements"
|
|
27
|
+
],
|
|
28
|
+
"excom": {
|
|
29
|
+
"packageType": "kit-element"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "node node_modules/@excom/heft-rig/scripts/vite-build.mjs",
|
|
33
|
+
"build:watch": "node node_modules/@excom/heft-rig/scripts/vite-build-watch.mjs",
|
|
34
|
+
"format": "node node_modules/@excom/heft-rig/scripts/format.mjs",
|
|
35
|
+
"test": "node node_modules/@excom/heft-rig/scripts/vitest.mjs",
|
|
36
|
+
"coverage": "node node_modules/@excom/heft-rig/scripts/coverage.mjs",
|
|
37
|
+
"dev": "node node_modules/@excom/heft-rig/scripts/vite-dev.mjs",
|
|
38
|
+
"preview": "node node_modules/@excom/heft-rig/scripts/vite-preview.mjs",
|
|
39
|
+
"build:package-metas": "node node_modules/@excom/heft-rig/scripts/build-package-metas.mjs",
|
|
40
|
+
"build:docs": "node node_modules/@excom/heft-rig/scripts/build-docs.mjs"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Caching has been disabled for this project's "apply-exports" command.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Invoking: cd "$RUSH_PROJECT_FOLDER" && node ../heft-rig/scripts/apply-exports.mjs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This project does not define the caching behavior of the "build:docs" command, so caching has been disabled.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Invoking: node node_modules/@excom/heft-rig/scripts/build-docs.mjs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This project does not define the caching behavior of the "build:package-metas" command, so caching has been disabled.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Invoking: node node_modules/@excom/heft-rig/scripts/build-package-metas.mjs
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"modules": [
|
|
4
|
+
{
|
|
5
|
+
"kind": "javascript-module",
|
|
6
|
+
"path": "detect-browser.ts",
|
|
7
|
+
"declarations": [
|
|
8
|
+
{
|
|
9
|
+
"kind": "class",
|
|
10
|
+
"name": "DetectBrowser",
|
|
11
|
+
"customElement": true,
|
|
12
|
+
"tagName": "detect-browser",
|
|
13
|
+
"summary": "CSS-selectable browser, OS, and device metadata.",
|
|
14
|
+
"description": "Zero-JS browser / OS / device metadata provider. Sets attributes once on connect so plain CSS can target Safari, iOS, standalone (installed PWA) mode, and more — no app JavaScript required. Values with no CSS-friendly attribute form (full user agent, language list, hardware hints) live on the `.provision` property instead.",
|
|
15
|
+
"attributes": [
|
|
16
|
+
{
|
|
17
|
+
"name": "browser-name",
|
|
18
|
+
"type": {
|
|
19
|
+
"text": "string"
|
|
20
|
+
},
|
|
21
|
+
"description": "Detected browser family.",
|
|
22
|
+
"fieldName": "browserName",
|
|
23
|
+
"values": [
|
|
24
|
+
"chrome",
|
|
25
|
+
"firefox",
|
|
26
|
+
"safari",
|
|
27
|
+
"edge",
|
|
28
|
+
"opera",
|
|
29
|
+
"internet explorer"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "browser-version",
|
|
34
|
+
"type": {
|
|
35
|
+
"text": "string"
|
|
36
|
+
},
|
|
37
|
+
"description": "Browser version, as reported by the user agent string.",
|
|
38
|
+
"fieldName": "browserVersion"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "browser-engine",
|
|
42
|
+
"type": {
|
|
43
|
+
"text": "string"
|
|
44
|
+
},
|
|
45
|
+
"description": "Rendering engine.",
|
|
46
|
+
"fieldName": "browserEngine",
|
|
47
|
+
"values": [
|
|
48
|
+
"blink",
|
|
49
|
+
"gecko",
|
|
50
|
+
"webkit",
|
|
51
|
+
"trident"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "browser-vendor",
|
|
56
|
+
"type": {
|
|
57
|
+
"text": "string"
|
|
58
|
+
},
|
|
59
|
+
"description": "`navigator.vendor`, lowercased.",
|
|
60
|
+
"fieldName": "browserVendor"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "operating-system",
|
|
64
|
+
"type": {
|
|
65
|
+
"text": "string"
|
|
66
|
+
},
|
|
67
|
+
"description": "Detected OS and, where available, version.",
|
|
68
|
+
"fieldName": "operatingSystem",
|
|
69
|
+
"values": [
|
|
70
|
+
"windows 10+",
|
|
71
|
+
"windows 8.1",
|
|
72
|
+
"windows 8",
|
|
73
|
+
"windows 7",
|
|
74
|
+
"macos <version>",
|
|
75
|
+
"android",
|
|
76
|
+
"ios",
|
|
77
|
+
"linux"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "operating-platform",
|
|
82
|
+
"type": {
|
|
83
|
+
"text": "string"
|
|
84
|
+
},
|
|
85
|
+
"description": "`navigator.userAgentData.platform` (falls back to `navigator.platform`), lowercased.",
|
|
86
|
+
"fieldName": "operatingPlatform"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "device-type",
|
|
90
|
+
"type": {
|
|
91
|
+
"text": "string"
|
|
92
|
+
},
|
|
93
|
+
"description": "Coarse device class inferred from the user agent string.",
|
|
94
|
+
"fieldName": "deviceType",
|
|
95
|
+
"values": [
|
|
96
|
+
"mobile",
|
|
97
|
+
"desktop"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "is-standalone",
|
|
102
|
+
"type": {
|
|
103
|
+
"text": "boolean"
|
|
104
|
+
},
|
|
105
|
+
"description": "Present when running in standalone / installed PWA mode.",
|
|
106
|
+
"fieldName": "isStandalone"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "language-id",
|
|
110
|
+
"type": {
|
|
111
|
+
"text": "string"
|
|
112
|
+
},
|
|
113
|
+
"description": "`navigator.language`, lowercased.",
|
|
114
|
+
"fieldName": "languageId"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "cookies-enabled",
|
|
118
|
+
"type": {
|
|
119
|
+
"text": "boolean"
|
|
120
|
+
},
|
|
121
|
+
"description": "Present when `navigator.cookieEnabled` is `true`.",
|
|
122
|
+
"fieldName": "cookiesEnabled"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "do-not-track",
|
|
126
|
+
"type": {
|
|
127
|
+
"text": "string"
|
|
128
|
+
},
|
|
129
|
+
"description": "`navigator.doNotTrack`, as reported by the browser.",
|
|
130
|
+
"fieldName": "doNotTrack"
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"members": [
|
|
134
|
+
{
|
|
135
|
+
"kind": "field",
|
|
136
|
+
"name": "browserName",
|
|
137
|
+
"type": {
|
|
138
|
+
"text": "string"
|
|
139
|
+
},
|
|
140
|
+
"privacy": "public",
|
|
141
|
+
"readonly": true,
|
|
142
|
+
"description": "Detected browser family.",
|
|
143
|
+
"_neutron": {
|
|
144
|
+
"surface": "state"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"kind": "field",
|
|
149
|
+
"name": "browserVersion",
|
|
150
|
+
"type": {
|
|
151
|
+
"text": "string"
|
|
152
|
+
},
|
|
153
|
+
"privacy": "public",
|
|
154
|
+
"readonly": true,
|
|
155
|
+
"description": "Browser version, as reported by the user agent string.",
|
|
156
|
+
"_neutron": {
|
|
157
|
+
"surface": "state"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"kind": "field",
|
|
162
|
+
"name": "browserEngine",
|
|
163
|
+
"type": {
|
|
164
|
+
"text": "string"
|
|
165
|
+
},
|
|
166
|
+
"privacy": "public",
|
|
167
|
+
"readonly": true,
|
|
168
|
+
"description": "Rendering engine.",
|
|
169
|
+
"_neutron": {
|
|
170
|
+
"surface": "state"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"kind": "field",
|
|
175
|
+
"name": "browserVendor",
|
|
176
|
+
"type": {
|
|
177
|
+
"text": "string"
|
|
178
|
+
},
|
|
179
|
+
"privacy": "public",
|
|
180
|
+
"readonly": true,
|
|
181
|
+
"description": "`navigator.vendor`, lowercased.",
|
|
182
|
+
"_neutron": {
|
|
183
|
+
"surface": "state"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"kind": "field",
|
|
188
|
+
"name": "operatingSystem",
|
|
189
|
+
"type": {
|
|
190
|
+
"text": "string"
|
|
191
|
+
},
|
|
192
|
+
"privacy": "public",
|
|
193
|
+
"readonly": true,
|
|
194
|
+
"description": "Detected OS and, where available, version.",
|
|
195
|
+
"_neutron": {
|
|
196
|
+
"surface": "state"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"kind": "field",
|
|
201
|
+
"name": "operatingPlatform",
|
|
202
|
+
"type": {
|
|
203
|
+
"text": "string"
|
|
204
|
+
},
|
|
205
|
+
"privacy": "public",
|
|
206
|
+
"readonly": true,
|
|
207
|
+
"description": "`navigator.userAgentData.platform` (falls back to `navigator.platform`), lowercased.",
|
|
208
|
+
"_neutron": {
|
|
209
|
+
"surface": "state"
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"kind": "field",
|
|
214
|
+
"name": "deviceType",
|
|
215
|
+
"type": {
|
|
216
|
+
"text": "string"
|
|
217
|
+
},
|
|
218
|
+
"privacy": "public",
|
|
219
|
+
"readonly": true,
|
|
220
|
+
"description": "Coarse device class inferred from the user agent string.",
|
|
221
|
+
"_neutron": {
|
|
222
|
+
"surface": "state"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"kind": "field",
|
|
227
|
+
"name": "isStandalone",
|
|
228
|
+
"type": {
|
|
229
|
+
"text": "boolean"
|
|
230
|
+
},
|
|
231
|
+
"privacy": "public",
|
|
232
|
+
"readonly": true,
|
|
233
|
+
"description": "Present when running in standalone / installed PWA mode.",
|
|
234
|
+
"_neutron": {
|
|
235
|
+
"surface": "state"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"kind": "field",
|
|
240
|
+
"name": "languageId",
|
|
241
|
+
"type": {
|
|
242
|
+
"text": "string"
|
|
243
|
+
},
|
|
244
|
+
"privacy": "public",
|
|
245
|
+
"readonly": true,
|
|
246
|
+
"description": "`navigator.language`, lowercased.",
|
|
247
|
+
"_neutron": {
|
|
248
|
+
"surface": "state"
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"kind": "field",
|
|
253
|
+
"name": "cookiesEnabled",
|
|
254
|
+
"type": {
|
|
255
|
+
"text": "boolean"
|
|
256
|
+
},
|
|
257
|
+
"privacy": "public",
|
|
258
|
+
"readonly": true,
|
|
259
|
+
"description": "Present when `navigator.cookieEnabled` is `true`.",
|
|
260
|
+
"_neutron": {
|
|
261
|
+
"surface": "state"
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"kind": "field",
|
|
266
|
+
"name": "doNotTrack",
|
|
267
|
+
"type": {
|
|
268
|
+
"text": "string"
|
|
269
|
+
},
|
|
270
|
+
"privacy": "public",
|
|
271
|
+
"readonly": true,
|
|
272
|
+
"description": "`navigator.doNotTrack`, as reported by the browser.",
|
|
273
|
+
"_neutron": {
|
|
274
|
+
"surface": "state"
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"kind": "field",
|
|
279
|
+
"name": "provision",
|
|
280
|
+
"type": {
|
|
281
|
+
"text": "BrowserInfo",
|
|
282
|
+
"expanded": "{ 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; }"
|
|
283
|
+
},
|
|
284
|
+
"privacy": "public",
|
|
285
|
+
"readonly": false,
|
|
286
|
+
"description": "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.",
|
|
287
|
+
"_neutron": {
|
|
288
|
+
"surface": "option"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"_neutron": {
|
|
293
|
+
"provisions": [
|
|
294
|
+
{
|
|
295
|
+
"name": "provision",
|
|
296
|
+
"type": {
|
|
297
|
+
"text": "BrowserInfo",
|
|
298
|
+
"expanded": "{ 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; }"
|
|
299
|
+
},
|
|
300
|
+
"description": "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.",
|
|
301
|
+
"fieldName": "provision"
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
],
|
|
307
|
+
"exports": [
|
|
308
|
+
{
|
|
309
|
+
"kind": "js",
|
|
310
|
+
"name": "DetectBrowser",
|
|
311
|
+
"declaration": {
|
|
312
|
+
"name": "DetectBrowser",
|
|
313
|
+
"module": "detect-browser.ts"
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"kind": "custom-element-definition",
|
|
318
|
+
"name": "detect-browser",
|
|
319
|
+
"declaration": {
|
|
320
|
+
"name": "DetectBrowser",
|
|
321
|
+
"module": "detect-browser.ts"
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
}
|