Skip to content

Commit 0b1b8db

Browse files
committed
chore: improve ua
1 parent c1a5053 commit 0b1b8db

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

templates/node/src/client.ts.twig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ function getUserAgent() {
5353
// @ts-ignore
5454
ua += ` ${navigator.userAgent}`;
5555

56+
// @ts-ignore
57+
} else if (typeof globalThis.EdgeRuntime === 'string') {
58+
ua += ` EdgeRuntime`;
59+
5660
// Older Node.js versions don't have `navigator.userAgent`, so we have to use `process.version`.
57-
} else if (typeof process !== 'undefined') {
61+
} else if (typeof process !== 'undefined' && typeof process.version === 'string') {
5862
ua += ` Node.js/${process.version}`;
5963
}
6064

0 commit comments

Comments
 (0)