diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..7ffa35b --- /dev/null +++ b/.env.example @@ -0,0 +1,17 @@ +# Socket / backend endpoint Synclify will fetch /create from and open a +# socket.io connection to. Without this, the extension falls back to +# http://localhost:3001 (see src/types/socket.ts) and "Create Room" fails +# with `Failed to fetch` in the background service worker. +# +# Set it to your own running synclify-server, e.g.: +# WXT_SOCKET_ENDPOINT=http://localhost:3001 +# WXT_SOCKET_ENDPOINT=https://your-server.example.com +# +# The upstream production URL lives only in GitHub Actions secrets +# (PLASMO_PUBLIC_SOCKET_ENDPOINT in .github/workflows/submit.yml) and is +# not committed to this repo. +WXT_SOCKET_ENDPOINT= + +# Optional PostHog telemetry. Leave blank to disable. +WXT_PUBLIC_POSTHOG_KEY= +WXT_PUBLIC_POSTHOG_HOST= diff --git a/.gitignore b/.gitignore index e2d2744..90f6d67 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ yarn-error.log* # local env files .env* +!.env.example out/ build/ diff --git a/src/entrypoints/background.ts b/src/entrypoints/background.ts index f319301..99ee462 100644 --- a/src/entrypoints/background.ts +++ b/src/entrypoints/background.ts @@ -312,6 +312,15 @@ export default defineBackground(async () => { hostPatterns: [/mubi\.com$/], videoSelector: "video", playerContainer: ".player" + }, + vkvideo: { + hostPatterns: [/(^|\.)vkvideo\.ru$/, /(^|\.)vk\.com$/], + videoSelector: '[data-testid="video-container"] video', + playerContainer: ".vk-vp-root", + watchPageTest: () => + /^\/video_ext\.php/.test(location.pathname) || + /^\/video-?\d+_\d+/.test(location.pathname), + excludeSelector: ".ads-container video" } } @@ -322,6 +331,8 @@ export default defineBackground(async () => { "#hudson-wrapper", '[data-testid="playerContainer"]', ".ContentPlayer", + ".vk-vp-root", + '[data-testid="video-container"]', ".html5-video-player", ".video-player", ".jw-wrapper", @@ -374,29 +385,66 @@ export default defineBackground(async () => { ) } - /* Find candidate videos */ + /* Deep-walk that crosses open shadow roots. VK Video, and a growing + number of modern players, mount their