From 8a50d203430c2b808cb0c2b805cf19f1c4d73e63 Mon Sep 17 00:00:00 2001 From: Bennett Date: Sat, 20 Aug 2022 17:42:42 +0200 Subject: [PATCH] Improve tab capture detection --- .nvmrc | 1 + package.json | 4 +++- pnpm-lock.yaml | 2 +- src/shared/platform.ts | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..8e2afd3 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +17 \ No newline at end of file diff --git a/package.json b/package.json index 232f1b7..014daf9 100644 --- a/package.json +++ b/package.json @@ -12,15 +12,17 @@ }, "scripts": { "dev": "plasmo dev --target=chrome-mv2", + "dev:mv3": "plasmo dev --target=chrome-mv3", "dev:firefox": "plasmo dev --target=firefox-mv2", "build": "plasmo build --target=chrome-mv2 --zip", + "build:mv3": "plasmo build --target=chrome-mv3 --zip", "build:firefox": "plasmo build --target=firefox-mv2 --zip" }, "dependencies": { "@parcel/core": "^2.6.1", "@types/debug": "^4.1.7", "@types/webextension-polyfill": "^0.9.0", - "@vantezzen/plasmo-state": "1.0.7", + "@vantezzen/plasmo-state": "^1.0.7", "debug": "^4.3.4", "fontsource-poppins": "^4.0.0", "intro.js": "^5.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 551eff5..79d63e7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ specifiers: '@types/react': 18.0.14 '@types/react-dom': 18.0.5 '@types/webextension-polyfill': ^0.9.0 - '@vantezzen/plasmo-state': 1.0.7 + '@vantezzen/plasmo-state': ^1.0.7 debug: ^4.3.4 fontsource-poppins: ^4.0.0 intro.js: ^5.1.0 diff --git a/src/shared/platform.ts b/src/shared/platform.ts index 5a5715e..d397441 100644 --- a/src/shared/platform.ts +++ b/src/shared/platform.ts @@ -1,2 +1,3 @@ export const isChromium = navigator.userAgent.includes("Chrome") -export const supportsTabCapture = isChromium +export const supportsTabCapture = + isChromium && process.env.PLASMO_MANIFEST_VERSION === "v2"