From 54ff338b09ce9ec335ae4b6ba1cab2327d10b764 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Mon, 24 Jun 2024 00:50:34 -0700 Subject: [PATCH] =?UTF-8?q?Incorporate=20Atmosph=C3=A8re=20version=20into?= =?UTF-8?q?=20`navigator.userAgent`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/neat-goats-taste.md | 5 +++++ packages/runtime/src/navigator.ts | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .changeset/neat-goats-taste.md diff --git a/.changeset/neat-goats-taste.md b/.changeset/neat-goats-taste.md new file mode 100644 index 00000000..56785f3b --- /dev/null +++ b/.changeset/neat-goats-taste.md @@ -0,0 +1,5 @@ +--- +"nxjs-runtime": patch +--- + +Incorporate Atmosphère version into `navigator.userAgent` diff --git a/packages/runtime/src/navigator.ts b/packages/runtime/src/navigator.ts index db82a7f4..84607b56 100644 --- a/packages/runtime/src/navigator.ts +++ b/packages/runtime/src/navigator.ts @@ -72,7 +72,14 @@ export class Navigator { get userAgent() { if (!state.ua) { const { name, version } = Application.self; - state.ua = `${name}/${version} (Switch; en-us) nx.js/${$.version.nxjs}`; + const rv = [$.version.hos]; + const ams = $.version.ams; + if (ams) { + rv.push(`AMS ${ams}`, $.version.emummc ? 'E' : 'S'); + } + state.ua = `${name}/${version} (Switch; en-us; rv:${rv.join( + '|', + )}) nx.js/${$.version.nxjs}`; } return state.ua; }