From d8d5eab00a758a2919dd529826a731e7fd60683b Mon Sep 17 00:00:00 2001 From: Paramtamtam <7326800+tarampampam@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:07:04 +0400 Subject: [PATCH 1/2] feat: Overload Navigator.maxTouchPoints property for android and iOS devices --- src/entrypoints/content/inject.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/entrypoints/content/inject.ts b/src/entrypoints/content/inject.ts index 7a7b8685..5214e00c 100644 --- a/src/entrypoints/content/inject.ts +++ b/src/entrypoints/content/inject.ts @@ -198,6 +198,16 @@ import type { DeepWriteable } from '~/types' overload(n, 'oscpu', undefined, { force: true }) } + /** + * @link https://developer.mozilla.org/en-US/docs/Web/API/Navigator/maxTouchPoints + */ + switch (payload.current.os) { + case 'android': + case 'iOS': + overload(n, 'maxTouchPoints', 10) + break + } + // to test, execute in the console: `console.log(navigator.vendor)` switch (payload.current.browser) { case 'chrome': From 93fbe1f426c87955be9ce623bf7b2f484b559322 Mon Sep 17 00:00:00 2001 From: Paramtamtam <7326800+tarampampam@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:12:27 +0400 Subject: [PATCH 2/2] =?UTF-8?q?wip:=20=F0=9F=94=95=20temporary=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entrypoints/content/inject.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entrypoints/content/inject.ts b/src/entrypoints/content/inject.ts index 5214e00c..4a4b17fa 100644 --- a/src/entrypoints/content/inject.ts +++ b/src/entrypoints/content/inject.ts @@ -204,7 +204,7 @@ import type { DeepWriteable } from '~/types' switch (payload.current.os) { case 'android': case 'iOS': - overload(n, 'maxTouchPoints', 10) + overload(n, 'maxTouchPoints', n.maxTouchPoints || 10) break }