diff --git a/.github/workflows/browser-ci.yml b/.github/workflows/browser-ci.yml index baeddb3..98369e2 100644 --- a/.github/workflows/browser-ci.yml +++ b/.github/workflows/browser-ci.yml @@ -72,7 +72,6 @@ jobs: run: bun run firefox:verify - name: Audit dependencies - # node-forge (web-ext > adbkit, a development tool that never ships) has no - # patched release yet, so this one advisory is named and the rest still fail. - # Remove the flag once node-forge has a fix. - run: bun audit --ignore GHSA-86w9-cpqp-85rv + # Fails only on high and critical advisories. Low and moderate ones are reported + # but do not fail the build, since many have no fixed release yet. + run: bun audit --audit-level=high diff --git a/CHANGELOG.md b/CHANGELOG.md index 06df090..5b46aba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # VERSION 1 +## V1.2.0 - IN DEVELOPMENT + +This release carries the browser extension and userscript **1.2.0** and Parousia Desktop **1.0.2**. Versions are set in the manifests, `package.json`, and `desktop/Cargo.toml`; `scripts/release-check.mjs` checks they agree with the tag. + +### ✨ New Features + +- **Activity Versions:** Every Activity's page in the dashboard shows its version, taken from its own `metadata.json`: Parousia's native Activities and the bundled PreMiD ones alike. Only each Activity's manifest carries it, so the catalog the dashboard lists and searches doesn't grow. +- **Site Activity Beside the Default Activity:** While the Default Activity is shared, the popup still shows the tab's own Activity when its site has one. Turn it on there, or see why it can't run (access not granted, or nothing to share yet). +- **Show Media Presence:** A new switch in `Settings > Privacy`, off by default. With it on, music or video you were playing stays on your profile when you move to a site that has no Activity (or a browser page), until the sound stops, its tab closes, or its Activity is turned off. Only an Activity that presents as listening or watching, or that has an end time, counts, and only while the tab is making sound. An Activity on the tab you're looking at comes first, and the Default Activity only shows when no music or video is kept. With several players, the one you looked at last is shown. Private windows follow their own setting. Nothing is injected into the tab it comes from. A song skipped in a tab you left reaches Discord, the music stays when the extension's background restarts, and the popup still offers the current site's own Activity beside it, so you can turn it on or allow it without turning this off. +- **Plainer Wording:** Shorter, more direct text across the popup, dashboard, settings, and every translation. Terms are consistent: "Activity" for a site's integration, "presence" for what's shown on Discord. Parousia Desktop's port, pipe, and tray messages are shorter too (Desktop 1.0.2). + +### 🛡️ Stability & Privacy + +- **Discord Connection (Linux and macOS):** A Discord that stops reading its socket no longer holds Desktop's Discord connection forever. A write it doesn't take within 5 seconds ends the connection, and Desktop retries as it does after a Discord restart. Windows already did this. This is a Desktop change, so it ships in Parousia Desktop **1.0.2**. Update Desktop with the extension: with Show media presence on, the connection to Discord stays open for hours, so on Desktop 1.0.1 a Discord that stops listening is much easier to hit. +- **Switches Are Read Before Anything Runs:** When the extension started, an Activity ran on its default until its stored switch loaded, so one you had turned off could run once on the first tab. The extension now waits for the stored switches before any Activity is run or injected. +- **Paused Private Tabs Run Nothing:** With `Settings > Privacy > Private windows` on "Pause activity", no Activity runs for a private tab: its code isn't called and its page scripts aren't injected. Scripts already running there stop when you change the setting. Before, they ran and the result was dropped. +- **What a Switch Guarantees:** `project/threat-model.md` (Disabled Activities) lists exactly what stops when an Activity is off, and what doesn't. + ## [V1.1.0](https://github.com/Abadima/RPC/releases/tag/v1.1.0) - V1 FIRST STABLE RELEASE This release carries the browser extension and userscript **1.1.0** (the Firefox build is **1.1.0.1**) and Parousia Desktop **1.0.1**. It is the first stable release, with everything since the first public beta. diff --git a/README.md b/README.md index 6a4544a..03c7484 100644 --- a/README.md +++ b/README.md @@ -18,22 +18,21 @@ ## What is Parousia? -Parousia is an open-source Rich Presence platform that brings your browser activity to your favourite Rich Presence platform, starting with Discord. +Parousia is an open-source Rich Presence platform. It shows what you're doing in your browser on Discord, and on other platforms as they're supported. -Parousia consists of a lightweight browser extension and native desktop application, with no account or sign-in required. +It has two parts: a browser extension and a small native desktop app. No account or sign-in is needed. ## Features -- **Rich Presence** for supported websites and web applications -- **Activities** for native and PreMiD integrations -- **Local-first architecture** with browser-to-desktop communication over loopback -- **No account or sign-in required** -- **No analytics or telemetry** -- **Minimal permissions** with website access requested only when an Activity needs it -- **Discord integration** through the official local RPC interface -- **Cross-platform Desktop** support for Windows and Linux, with macOS planned -- **Developer-friendly Activity API** built with TypeScript -- **Lightweight native Desktop** application written in Rust +- **Rich Presence** for supported websites and web apps +- **Activities** from Parousia and PreMiD +- **Local only**: the browser talks to the desktop app over loopback +- **No account, no analytics, no telemetry** +- **Minimal permissions**: website access is requested only when an Activity needs it +- **Discord** through its official local RPC interface +- **Windows and Linux** desktop support, with macOS planned +- **A TypeScript API** for writing Activities +- **A lightweight desktop app** written in Rust ## Get Parousia @@ -50,27 +49,24 @@ Parousia consists of a lightweight browser extension and native desktop applicat | ---------- | ----------- | ---------------------------------------------------------- | | Windows | Available | [GitHub Releases](https://github.com/Abadima/RPC/releases) | | Linux | Available | [GitHub Releases](https://github.com/Abadima/RPC/releases) | -| macOS | Coming soon | — | +| macOS | Coming soon | Not yet | | Userscript | Available | [GitHub Releases](https://github.com/Abadima/RPC/releases) | -| | ## Activity Ecosystem -Activities are maintained separately from the core Parousia repository and use a shared Activity API. +Activities live in their own repositories and share one API: **[parousia-project/activities](https://github.com/parousia-project/activities)** **[premid/activities](https://github.com/premid/activities)** -Activities are organized by website and can provide their own settings, page data requirements, site access, Discord applications, and Rich Presence details. +Each Activity covers a website. It sets its own settings, page data, site access, Discord application, and Rich Presence details. -Parousia currently includes the native Activity ecosystem alongside a large selection of compatible PreMiD Activities. +Parousia includes the native Activities and a large set of compatible PreMiD Activities. ## Documentation -Full documentation covering installation, configuration, Activities, compatibility, privacy, security, and development is available at: - -**[parousia.abadima.dev](https://parousia.abadima.dev)** (Maintained in **[parousia-project/website](https://github.com/parousia-project/website)**) +Installation, configuration, Activities, compatibility, privacy, security, and development are covered at **[parousia.abadima.dev](https://parousia.abadima.dev)**. The site is built from **[parousia-project/website](https://github.com/parousia-project/website)**. ## Roadmap @@ -86,16 +82,12 @@ See [`project/roadmap.md`](project/roadmap.md) for the current roadmap. ## Contributing -Contributions, issues, and discussions are welcome. - -See [`CONTRIBUTING.md`](.github/CONTRIBUTING.md) to get started. +Issues, discussions, and pull requests are welcome. Start with [`CONTRIBUTING.md`](.github/CONTRIBUTING.md). -Security vulnerabilities should be reported privately according to [`SECURITY.md`](.github/SECURITY.md). +Report security vulnerabilities privately, as [`SECURITY.md`](.github/SECURITY.md) describes. ## License Parousia is licensed under the [Apache License 2.0](LICENSE). -The repository also contains third-party components under their respective licenses, including PreMiD Activities under the Mozilla Public License 2.0, a font under the SIL Open Font License, and icons under CC BY 4.0. - -Each extension release includes `THIRD-PARTY-NOTICES.txt`, and Desktop releases include `parousia-desktop-notices.txt` for statically linked Rust dependencies. +Third-party components keep their own licenses: PreMiD Activities are under the Mozilla Public License 2.0, the font under the SIL Open Font License, and the icons under CC BY 4.0. Each extension release includes `THIRD-PARTY-NOTICES.txt`. Desktop releases include `parousia-desktop-notices.txt`, which lists the statically linked Rust dependencies. diff --git a/browser/README.md b/browser/README.md index 25d5244..ecc23fb 100644 --- a/browser/README.md +++ b/browser/README.md @@ -1,46 +1,46 @@ # browser -Parousia's browser extension, built with [Bun](https://bun.com) + strict TypeScript. +Parousia's browser extension and userscript, built with [Bun](https://bun.com) and strict TypeScript. ## Setup ```bash bun install -bun run activities:fetch # the Activity sources, at the newest commit on each one's main +bun run activities:fetch # Activity sources, at the newest commit on each main branch ``` ## Commands ```bash -bun run build # build all targets into dist/ +bun run build # build every target into dist/ bun run dev # build, then rebuild on change -bun run typecheck # tsc --noEmit -bun run lint # oxlint -bun run format # oxfmt -bun run format:check # oxfmt --check -bun test # bun test - -bun run activities:fetch # move each Activity source to the newest commit on its main now (every build does this itself; a failed fetch keeps the copy it has) -bun run activities:check # check and compile every Activity; list PreMiD ones left out, and why - -bun run firefox:setup # one-time: fetch an isolated automation Firefox build -bun run firefox:lint # web-ext lint against dist/firefox -bun run firefox:verify # lint + actually install & run dist/firefox in real Firefox -bun run chromium:setup # one-time: fetch an isolated automation Chromium build -bun run desktop:verify # the Browser <-> Desktop link, end to end, in automation Chromium (Linux, Windows) -bun run real:verify # the same against installed browsers: Firefox, Flatpak Chromium, Violentmonkey -bun run discord:verify # a real Activity on a real Discord (opt-in, see below) -bun run activities:verify # Activities, the popup, and the dashboard, end to end (Linux, Windows) -bun run activities:firefox # the same features in installed Firefox Developer Edition -bun run languages:verify # every language in the popup and dashboard, Automatic, and a change reaching an open view (automation Chromium) -bun run bench # sizes, memory, CPU, and latency, as JSON -bun run contrast # WCAG 2.2 AA contrast of every theme's tokens, as a table -bun run themes:verify # the themes on every popup and dashboard view, in automation Chromium +bun run typecheck # tsc --noEmit +bun run lint # oxlint +bun run format # oxfmt +bun run format:check # oxfmt --check +bun test # unit tests + +bun run activities:fetch # move each Activity source to the newest commit on its main (builds do this too; a failed fetch keeps the copy it has) +bun run activities:check # check and compile every Activity; list the PreMiD ones left out, and why + +bun run firefox:setup # once: fetch an isolated automation Firefox +bun run firefox:lint # web-ext lint of dist/firefox +bun run firefox:verify # lint, then install and run dist/firefox in real Firefox +bun run chromium:setup # once: fetch an isolated automation Chromium +bun run desktop:verify # the browser-to-Desktop link, end to end, in automation Chromium (Linux, Windows) +bun run real:verify # the same against installed browsers: Firefox, Flatpak Chromium, Violentmonkey +bun run discord:verify # one Activity on a real Discord (opt-in, see below) +bun run activities:verify # Activities, the popup, and the dashboard, end to end (Linux, Windows) +bun run activities:firefox # the same features in an installed Firefox Developer Edition +bun run languages:verify # every language in the popup and dashboard, and a change reaching an open view +bun run bench # sizes, memory, CPU, and latency, as JSON +bun run contrast # WCAG 2.2 AA contrast of each theme's tokens, as a table +bun run themes:verify # each theme on every popup and dashboard view ``` ## Build Targets -`bun run build` produces one folder per target under `dist/`, each a self-contained, minified bundle plus its `manifest.json`: +`bun run build` writes one folder per target under `dist/`. Each is a self-contained, minified bundle with its `manifest.json`: | Target | Output | Distribution | | ------------ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------- | @@ -48,106 +48,162 @@ bun run themes:verify # the themes on every popup and dashboard view, in automa | `firefox` | `dist/firefox/` | Firefox Add-ons (inspectable). | | `userscript` | `dist/userscript/` | `parousia.user.js`, installed through a userscript manager (Violentmonkey, Tampermonkey, ScriptCat) | -`dist/chromium.zip` and `dist/firefox.zip` are the same files zipped at the archive root, ready to upload to a store or attach to a release. `dist/userscript/parousia.user.js.gz` is the userscript compressed for mirrors that serve it precompressed; a manager installs the plain `.user.js`. +`dist/chromium.zip` and `dist/firefox.zip` hold the same files, zipped at the root and ready for a store or a release. `dist/userscript/parousia.user.js.gz` is the userscript, precompressed for mirrors. Managers install the plain `.user.js`. -There is no Safari target. The code sticks to standard WebExtension APIs (`chrome.*`), so one stays possible, but nothing builds or releases it (see `project/architecture.md`, Recognized Builds). +There's no Safari target. The code uses standard `chrome.*` APIs, so one is possible later, but nothing builds or releases it. -Manifests live in `manifests/` and are validated (must declare `"manifest_version": 3`) as part of the build. `dist/` is fully cleaned before every build, so the zips are always rebuilt from scratch, never patched. +Manifests live in `manifests/` and must declare `"manifest_version": 3`, which the build checks. `dist/` is cleared before every build, so the zips are always rebuilt, never patched. -JS is minified via Bun's own `--minify`, with no separate minifier dependency: it takes `chromium.js` from 27.9 KB to 13.4 KB raw (7.2 KB to 4.8 KB gzipped). Layering `uglify-js` on top shaved off only about 3.5% more gzipped in earlier testing, not enough to justify the dependency. `DesktopConnection` uses `#private` members because Bun shortens those and not ordinary property names. +JS is minified with Bun's own `--minify`, with no minifier dependency: `chromium.js` goes from 27.9 KB to 13.4 KB (7.2 KB to 4.8 KB gzipped). Adding `uglify-js` saved only about 3.5% more gzipped in earlier tests, which isn't worth a dependency. `DesktopConnection` uses `#private` members because Bun shortens those but not ordinary property names. -The zips are written by a small dependency-free zip writer (`scripts/zip.ts`, using only `node:zlib`): `Bun.Archive` only produces tar/gzip, and a real `.zip` is what the stores need. It sorts entries and fixes timestamps, so the same files always give the same archive. +The zips come from a small writer with no dependencies (`scripts/zip.ts`, using `node:zlib`), because `Bun.Archive` writes only tar and gzip and stores need a real `.zip`. It sorts entries and fixes timestamps, so the same files always give the same archive. -The userscript is the same Bun minification (11.9 KB raw, 4.7 KB gzipped, 4.2 KB with brotli) with its `==UserScript==` header on top. Dropping `console` calls would save 27 bytes and silence the logger, so they stay. +The userscript is minified the same way (11.9 KB raw, 4.7 KB gzipped, 4.2 KB with brotli) and keeps its `==UserScript==` header. Dropping `console` calls would save 27 bytes but silence the logger, so they stay. ## Firefox Verification -`bun run firefox:verify` (after `bun run firefox:setup` once) actually installs `dist/firefox` as a temporary add-on in a real, isolated Firefox engine and confirms it loads, not just that the build succeeded. It never touches a system-installed Firefox; `firefox:setup` downloads a dedicated automation build via `playwright-core` specifically so this can't ever interact with someone's actual browser session. +`bun run firefox:verify` (run `firefox:setup` once first) installs `dist/firefox` as a temporary add-on in an isolated Firefox and checks that it loads. It never touches a system Firefox. `firefox:setup` downloads a separate automation build, so nothing can interact with a real browser session. -This check can't watch the background page's own console (web-ext's RDP client doesn't expose it, and WebDriver BiDi's `log.entryAdded` never fires for the background context). What the background actually does in Firefox is covered by `bun run real:verify`, which drives an installed Firefox over WebDriver BiDi, opens the extension's popup and dashboard pages, and connects to Desktop. +web-ext's RDP client can't read the background page's console, and WebDriver BiDi never logs its entries. `bun run real:verify` covers what the background does in Firefox: it drives an installed Firefox over WebDriver BiDi, opens the popup and dashboard, and connects to Desktop. ## Permissions -The extension requests `tabs`, which exposes a tab's `url`/`title` for Activity matching without granting page-content access, and `storage`. Reaching Desktop needs no permission: it's a WebSocket to `127.0.0.1`, allowed by the extension's CSP below. `storage` holds only the user's own settings (Privacy, Platforms, Language, which Activities are on with their settings, and the Default Activity) in `chrome.storage.local`, readable only by the extension's own pages (`setAccessLevel` in Chromium; in every browser, PreMiD's runtime takes the storage API out of the world PreMiD code runs in); nothing about browsing is stored, and there's no `alarms` permission. No `host_permissions` or static content scripts are declared: native Activities read the URL and title only. +The extension requests `tabs`, which gives the `url` and `title` that Activities match on without page-content access, and `storage`. Reaching Desktop needs no permission. It's a WebSocket to `127.0.0.1`, allowed by the CSP below. -Reading a page itself takes site access, which is always explicit: turning on an Activity that reads pages asks the browser for its sites, from the same click. Declined, the Activity stays off and says why; taken back later, it's unavailable on that site until access is granted again ("Allow access" in the popup or on its page). Settings > Site access has "Access your data for all websites", off by default and asked for only by its own switch. Individual sites aren't listed or revoked there: the browser owns those grants (its prompt, then its extension settings), and it doesn't let an extension take back every kind of grant, so a list here could disagree with the browser's own. Both are optional permissions (`optional_host_permissions: ["*://*/*"]` covers any site that can be asked for, plus `scripting`), so nothing is granted at install. Turning an Activity off gives back the sites no other Activity that's on needs, and `scripting` once nothing does. What Activities may read (what's playing, thumbnails, creator icons) is one choice for all of them, in Settings > Privacy. +`storage` holds only the user's settings in `chrome.storage.local`: Privacy, Platforms, Language, each Activity's on/off and settings, and the Default Activity. Chromium's `setAccessLevel` keeps content scripts out of it, and PreMiD's runtime removes the storage API from the world its code runs in, in every browser. Nothing about browsing is stored, and there's no `alarms` permission. No `host_permissions` or static content scripts are declared: native Activities read only the URL and title. -Without Parousia Desktop, Discord still works through Discord-RPC-Extension's app (`discord_rpc_ext`) if it's running: the extension connects to `ws://127.0.0.1:6969` and sends only Rich Presence (see `src/compat/discord-rpc-server.ts` and `project/architecture.md`). It's on by default and switched in Settings > Platforms, and it yields while Parousia Desktop is connected or still being tried, which then shows Discord itself: it never connects or probes port 6969 until Desktop has failed to answer, and lets go the moment Desktop connects. The end-to-end scripts turn it off in their test browsers, so they never touch a real app someone's Discord status depends on. +Reading a page takes site access, and it's always explicit. Turning on an Activity that reads pages asks the browser for its sites, from the same click. If declined, the Activity stays off and says why. If access is taken back later, the Activity is unavailable on that site until access is granted again ("Allow access" in the popup or on its page). -Extension pages carry an explicit Content Security Policy, `script-src 'self'; object-src 'self'; connect-src 'self' ws://127.0.0.1:57179 ws://127.0.0.1:6969 https://api.github.com`. Firefox's default MV3 policy includes `upgrade-insecure-requests`, which silently turns `ws://` into `wss://`; `connect-src` also limits extension pages to Desktop, Discord-RPC-Extension's app, and the one GitHub request below. +Settings > Site access has "Access your data for all websites": off by default, and asked for only by its own switch. Individual sites aren't listed there, because the browser owns those grants, and a list in Parousia could disagree with the browser's own. Both kinds are optional permissions (`optional_host_permissions: ["*://*/*"]`, plus `scripting`), so nothing is granted at install. Turning an Activity off gives back the sites no other Activity that's on needs, and `scripting` once none does. What Activities may read (what's playing, thumbnails, creator icons) is one choice for all of them, in Settings > Privacy. -That request is the extension's only one to anyone but the computer it runs on (`src/shared/latest-desktop.ts`). Desktop and the extension version on their own, so a newer extension next to an older Desktop is the normal result of a release, not a reason to say "update Desktop". When a popup or dashboard would say it, it asks `api.github.com/repos/Abadima/RPC/releases/latest` for the Desktop version the release notes name (``, written by the release workflow) and says it only if that is newer than the connected one. The request is unauthenticated, sends no cookies, referrer, or identifier, and is made at most once a day (an hour after a failure); the answer is kept in `chrome.storage.local`. If it fails, or the notes name nothing, no notice is shown. +Without Parousia Desktop, Discord still works through Discord-RPC-Extension's app (`discord_rpc_ext`), if it's running. The extension connects to `ws://127.0.0.1:6969` and sends only Rich Presence (`src/compat/discord-rpc-server.ts`, `project/architecture.md`). It's on by default and switched in Settings > Platforms. It yields while Parousia Desktop is connected or being tried, so Discord shows Desktop's presence. It doesn't connect to or probe port 6969 until Desktop has failed to answer, and it lets go as soon as Desktop connects. The end-to-end scripts turn it off in their test browsers, so they never touch a real app. -The Chromium manifest also declares `externally_connectable.ids` scoped to Discord-RPC-Extension's own published id (see Compatibility below), Chrome-only; Firefox has never implemented that manifest key at all, so the real, cross-browser restriction lives in code, not the manifest. +Extension pages carry an explicit CSP: `script-src 'self'; object-src 'self'; connect-src 'self' ws://127.0.0.1:57179 ws://127.0.0.1:6969 https://api.github.com`. Firefox's default MV3 policy adds `upgrade-insecure-requests`, which silently turns `ws://` into `wss://`, so the policy is set explicitly. `connect-src` limits extension pages to Desktop, the Discord-RPC-Extension app, and the GitHub request below. -The userscript grants itself only `GM_registerMenuCommand` (its "Parousia Desktop status" command), and runs in the manager's isolated world (`@inject-into content`, `@sandbox DOM`) so the page can't patch the WebSocket it uses. Greasemonkey 4 has no menu commands, so it isn't supported. +Apart from the dashboard's Activity icons (remote logos, loaded lazily with no referrer, with a letter as the fallback), the only request to anyone other than the local computer is the update check (`src/shared/latest-desktop.ts`). Desktop and the extension are versioned separately, so a newer extension beside an older Desktop is the normal result of a release, not a reason to say "update Desktop". When a popup or dashboard needs it, it asks `api.github.com/repos/Abadima/RPC/releases/latest` for the Desktop version named in the release notes (``, written by the release workflow), and says so only if that version is newer than the connected one. The request is unauthenticated and sends no cookies, referrer, or identifier. It runs at most once a day, or an hour after a failure, and the answer is cached in `chrome.storage.local`. If the request fails or the notes name no version, nothing is shown. + +The Chromium manifest also scopes `externally_connectable.ids` to Discord-RPC-Extension's own id (see Compatibility). That's Chrome only. Firefox has never implemented the key, so the real cross-browser check is in code. + +The userscript requests only `GM_registerMenuCommand` (its "Parousia Desktop status" command). It runs in the manager's isolated world (`@inject-into content`, `@sandbox DOM`), so the page can't patch the WebSocket it uses. Greasemonkey 4 has no menu commands, so it isn't supported. ## Communication -The background script owns the one connection to Parousia Desktop (`src/core/desktop-connection.ts`), a WebSocket to `ws://127.0.0.1:57179/ws` (`src/core/channel.ts`) carrying a small protocol (`src/core/desktop-protocol.ts`): `hello`, Desktop's `welcome` or `reject`, then Presence, each with the platforms it may be shown on (Settings > Platforms). Desktop decides who it talks to from the WebSocket `Origin`, which the browser sets; there's nothing to pair. `project/architecture.md` (Communication Protocol) has the details and `project/threat-model.md` the reasoning. +The background script owns the one connection to Parousia Desktop (`src/core/desktop-connection.ts`): a WebSocket to `ws://127.0.0.1:57179/ws` (`src/core/channel.ts`). It carries a small protocol (`src/core/desktop-protocol.ts`): `hello`, then Desktop's `welcome` or `reject`, then presence, each with the platforms it may be shown on (Settings > Platforms). Desktop decides who it talks to from the WebSocket `Origin`, which the browser sets. There's nothing to pair. `project/architecture.md` (Communication Protocol) has the details, and `project/threat-model.md` the reasoning. -It only connects while something needs Desktop: an Activity is being reported, or the popup or dashboard is open. It lets go 30 seconds later. While an Activity is shared, the background calls `runtime.getPlatformInfo()` every 20 seconds so MV3 doesn't stop it (Firefox stops an event page even with a busy WebSocket open). Retries come every 10 seconds on in-memory timers and stop entirely when nothing needs Desktop. The popup and dashboard never open a connection of their own; they hold a port to the background script (`src/core/ui-port.ts`), which keeps the connection up while they're open and carries its state, Desktop's status report, and settings changes. +The connection opens only while something needs Desktop: an Activity is being reported, or the popup or dashboard is open. It closes 30 seconds after that stops. While an Activity is shared, the background calls `runtime.getPlatformInfo()` every 20 seconds so MV3 doesn't stop it, since Firefox stops an event page even with a busy WebSocket open. Retries come every 10 seconds on in-memory timers and stop when nothing needs Desktop. The popup and dashboard never open a connection of their own. They hold a port to the background (`src/core/ui-port.ts`), which keeps the connection up while they're open and sends back its state, Desktop's status report, and settings changes. Getting connected: - **The Chrome Web Store build** of the Chromium extension is recognized out of the box. -- **Development builds and every Firefox install** (its `moz-extension://` origin is random per install) reach Desktop by an origin it has to be told about, once. The popup shows "Not allowed by Parousia Desktop" with the exact command (`Parousia-Desktop allow chrome-extension://…`), and the tray's Diagnostics → Refused menu has a one-click "Allow". `bun run dev` gives the Chromium build a stable id (from a per-machine key in `.dev-key.json`) and prints it. -- **The userscript** connects only after "Allow userscripts" is turned on in Desktop (tray, the extension's Settings, or `Parousia-Desktop set userscripts on`). Its manager menu's "Parousia Desktop status" says whether it's connected and how to allow it. +- **Development builds and every Firefox install** reach Desktop through an origin Desktop has to be told about, once. Firefox's `moz-extension://` origin is random per install. The popup shows "Not allowed by Parousia Desktop" with the exact command (`Parousia-Desktop allow chrome-extension://…`), and the tray's Diagnostics → Refused menu has a one-click "Allow". `bun run dev` gives the Chromium build a stable id (from a per-machine key in `.dev-key.json`) and prints it. +- **The userscript** connects only after "Allow userscripts" is on in Desktop (tray, the extension's Settings, or `Parousia-Desktop set userscripts on`). Its manager menu's "Parousia Desktop status" says whether it's connected and how to allow it. + +`bun run desktop:verify` checks the whole link in playwright-core's isolated Chromium, using the Desktop debug build (run `cargo build` in `desktop/` first) and a throwaway data directory. It covers Desktop absent and then starting, an unrecognized build refused and then allowed, two browsers at once, a test page on abadima.dev (served by the test) reaching Discord and following Settings > Platforms, disallowing connected browsers, userscripts off and then on, hostile input, a second launch, Desktop stopping, and the link letting go when idle. + +`bun run real:verify` runs the same kind of checks against installed browsers: Firefox Developer Edition over WebDriver BiDi, Flatpak Ungoogled Chromium over CDP, and the userscript in Violentmonkey. It runs Desktop with its tray, opens the real jena.systems in both browsers, and holds for `HOLD_MINUTES` (3 by default) with no extension page open, which tests the MV3 keepalive. Both need port 57179 free, and both give Desktop a fake Discord (`scripts/e2e/fake-discord.mjs`), never a real one. Jena Hub comes from parousia-project/activities, so these builds need those sources (`bun run activities:fetch`, or `PAROUSIA_ACTIVITIES_DIR`). -`bun run desktop:verify` checks the whole link with playwright-core's isolated Chromium and the Desktop debug build (`cargo build` in `desktop/` first), in a throwaway data directory: Desktop absent and starting later, an unrecognized build refused and then allowed, two browsers at once, an abadima.dev page (served by the test) reaching Discord and following Settings > Platforms, disallowing connected browsers, userscripts off and then allowed, hostile input, a second launch, Desktop stopping, and letting go when idle. `bun run real:verify` covers installed browsers on this machine (Firefox Developer Edition over WebDriver BiDi, the Flatpak Ungoogled Chromium over CDP, the userscript in Violentmonkey), runs Desktop with its tray, opens the real jena.systems in both browsers, and holds that for `HOLD_MINUTES` (3 by default) with no extension page open, which checks the MV3 background keepalive. Both need port 57179 free, and both give Desktop a fake Discord (`scripts/e2e/fake-discord.mjs`), never a real one. Jena Hub comes from parousia-project/activities, so the build they check needs those sources (`bun run activities:fetch`, or `PAROUSIA_ACTIVITIES_DIR`). +More checks: -`bun run youtube:verify` watches PreMiD's real YouTube and YouTube Music Activities on the real sites (it needs the network and port 57179, and gives Desktop a fake Discord): a video loading and playing, paused and resumed, a navigation that doesn't reload, a full reload, and YouTube Music. `bun run fallback:verify` checks that Discord-RPC-Extension's app (port 6969) is only a fallback: with a dashboard open it is never contacted while Desktop is connected, takes over when Desktop stops, and lets go when Desktop returns. It runs in a private network namespace (`unshare -rn`), so neither port needs to be free and a real app is never touched. `bun run malsync:firefox` checks MAL-Sync support in Firefox with a stand-in extension under MAL-Sync's own Firefox id (its background is the shipped build's relay, its content script answers like MAL-Sync's on an episode): the reply reaching Discord through Desktop under MAL-Sync's own Application with nothing of the page's address, the switch, a page it has nothing for being asked four times and then left alone, and MAL-Sync not being installed. It runs in a private network namespace too. `bun run real-extensions:fetch` (needs the network, once) caches the store builds of the real MAL-Sync and Discord-RPC-Extension and Discord-RPC-Extension's app, and `bun run malsync:real` runs them in Chromium and Firefox beside Parousia and Desktop (`MALSYNC_BROWSER=chromium` or `firefox` for one), in three sessions: beside Discord-RPC-Extension (what MAL-Sync does alone, next to Parousia's Activity, with MAL-Sync support on, under Share Media Details, and with MAL-Sync's own Discord setting off), without Discord-RPC-Extension, and without Parousia Desktop (Parousia's link and MAL-Sync taking the app's one slot from each other). +- `bun run youtube:verify` watches PreMiD's real YouTube and YouTube Music Activities on the real sites. It needs the network and port 57179, and gives Desktop a fake Discord. It checks loading, play, pause and resume, a navigation without a reload, a full reload, and YouTube Music. +- `bun run fallback:verify` checks that Discord-RPC-Extension's app (port 6969) is only a fallback. With a dashboard open, it's never contacted while Desktop is connected. It takes over when Desktop stops and lets go when Desktop returns. It runs in a private network namespace (`unshare -rn`), so neither port needs to be free and no real app is touched. +- `bun run malsync:firefox` checks MAL-Sync support in Firefox, with a stand-in extension under MAL-Sync's Firefox id. Its background is the shipped build's relay, and its content script answers like MAL-Sync's on an episode. It checks that the reply reaches Discord through Desktop under MAL-Sync's own Application without the page's address, the switch, a page with nothing to show that's asked four times and then left alone, and MAL-Sync not being installed. It also runs in a private network namespace. +- `bun run real-extensions:fetch` (needs the network, once) caches the store builds of MAL-Sync, Discord-RPC-Extension, and its app. `bun run malsync:real` runs them in Chromium and Firefox beside Parousia and Desktop (`MALSYNC_BROWSER=chromium` or `firefox` for one), in three sessions: beside Discord-RPC-Extension (MAL-Sync alone, next to Parousia's Activity, with MAL-Sync support on, under Share media details, and with MAL-Sync's own Discord setting off); without Discord-RPC-Extension; and without Parousia Desktop, where Parousia's link and MAL-Sync take turns with the app's one slot. +- `bun run activities:verify` builds its own copy: PreMiD's Activities, the native test ones in `scripts/activities/fixtures/parousia`, and a native DiscordJS Guide that the check writes, so one website is in both sources. It runs in playwright-core's isolated Chromium with Desktop and a fake Discord, and checks: + - the website in both sources listed once; the native Activity running until PreMiD's is chosen, then only PreMiD's, under its own Discord Application + - a real, unmodified PreMiD Activity (DiscordJS Guide, which reads the page's `

`) following a change on the page + - PreMiD's code in a content script can't reach the extension's storage or the dashboard's port + - Settings > Privacy withholding what's playing from every Activity + - an Activity that's on without access is unavailable, and the popup, its card, and its page say why + - a native Activity that reads pages, turned on from the popup, and the collector reading the page's Media Session + - "Configure Activity" in the popup, and the Default Activity from its dashboard tab + - Settings > Site access showing only the all-websites switch + - the layout from 360 to 2560 pixels wide -`bun run activities:verify` builds its own copy (PreMiD's Activities, the native test ones in `scripts/activities/fixtures/parousia`, and a native DiscordJS Guide written by the check, so one website is in both sources) and checks, in playwright-core's isolated Chromium with Desktop and a fake Discord: the website in both sources listed once, the native one running until PreMiD's is chosen, then only PreMiD's, as its own Discord Application; a real, unmodified PreMiD Activity (DiscordJS Guide, which reads the page's `

`) following a change on the page; that PreMiD code in a content script can't reach the extension's storage or use the dashboard's port; Settings > Privacy withholding what's playing for every Activity; an Activity that's on without its site unavailable, with the popup, its card, and its page saying why; a native Activity that reads pages turned on from the popup, and Parousia's collector reading the page's Media Session; "Configure activity" in the popup; the Default Activity from its dashboard tab; Settings > Site access showing only the all-websites switch; and the layout from 360 to 2560 pixels wide. `ACTIVITIES_BROWSER=flatpak bun run activities:verify` runs the same checks in the Flatpak Ungoogled Chromium installed on this machine. `bun run activities:firefox` checks the same features in the installed Firefox Developer Edition: a PreMiD Activity reaching Discord, the storage API gone from PreMiD's world, the popup for an Activity without its site, and the Default Activity. A browser grants a site only through a prompt automation can't answer, so these builds' manifests already hold the sites they test. + `ACTIVITIES_BROWSER=flatpak bun run activities:verify` runs the same checks in the installed Flatpak Ungoogled Chromium. `bun run activities:firefox` checks the same features in the installed Firefox Developer Edition: a PreMiD Activity reaching Discord, the storage API gone from PreMiD's world, the popup for an Activity without its site, and the Default Activity. A browser grants a site only through a prompt automation can't answer, so these builds' manifests already list the sites they test. -`bun run bench` measures what Parousia costs on this machine (package sizes; Desktop's startup, memory, threads, CPU, and wakeups idle, with three clients, and publishing; the extension background's heap and its process's memory and CPU idle and while sharing; how long a detected Activity takes to reach Discord; how long the popup and dashboard take to show) and prints JSON; `BENCH_DIST` and `PAROUSIA_DESKTOP_BIN` point it at other builds to compare. +- `bun run activities:verify` also covers Show media presence with a tab that really makes sound: the song staying on a site without an Activity, a song skipped in a hidden tab, two players, the background restarting, and the popup beside kept music and beside the Default Activity. +- `bun run bench` measures the cost: package sizes; Desktop's startup, memory, threads, CPU, and wakeups, idle, with three clients, and while publishing; the background's heap, and its process's memory and CPU, idle and while sharing; how long a detected Activity takes to reach Discord; and how long the popup and dashboard take to show. It prints JSON. `BENCH_DIST` and `PAROUSIA_DESKTOP_BIN` point it at other builds to compare. -`bun run discord:verify` is the one check against a real Discord: the extension on the real jena.systems, through Desktop, on the Discord account signed in on this machine, for `HOLD_SECONDS` (20 by default), then cleared. It refuses to run unless Discord's socket directory is named: `PAROUSIA_REAL_DISCORD_IPC_DIR="$XDG_RUNTIME_DIR" bun run discord:verify` (for the Flatpak Discord, `"$XDG_RUNTIME_DIR/app/com.discordapp.Discord"`). +`bun run discord:verify` is the one check against a real Discord. It runs the extension on the real jena.systems, through Desktop, on the Discord account signed in here, for `HOLD_SECONDS` (20 by default), then clears the status. It won't run unless Discord's socket directory is named: `PAROUSIA_REAL_DISCORD_IPC_DIR="$XDG_RUNTIME_DIR" bun run discord:verify`. For the Flatpak Discord, use `"$XDG_RUNTIME_DIR/app/com.discordapp.Discord"`. -**On Windows**, the checks use the same scripts. Desktop's own folders can't be moved by an environment variable there, so they set `PAROUSIA_DATA_DIR`, and the fake Discord is a named pipe (`PAROUSIA_DISCORD_IPC_PIPE`) instead of a directory. Point them at a Desktop build with `PAROUSIA_DESKTOP_BIN` (the `.exe` is the default under `desktop/target/debug`), and at a build of the extension made outside a synced folder with `PAROUSIA_BUILD_DIR`. `discord:verify` takes Discord's pipe up to its number: `$env:PAROUSIA_REAL_DISCORD_IPC_DIR = '\\.\pipe\discord-ipc-'; bun run discord:verify`. Desktop's tray, `Start at login`, single instance, CLI pipe, and port are checked with the real release build and the real Windows tray by `desktop/scripts/verify-windows.ps1` (see `desktop/README.md`). +**On Windows**, the checks use the same scripts. Desktop's folders can't be moved by an environment variable there, so the checks set `PAROUSIA_DATA_DIR` instead. The fake Discord is a named pipe (`PAROUSIA_DISCORD_IPC_PIPE`), not a directory. Set `PAROUSIA_DESKTOP_BIN` to a Desktop build (the `.exe` under `desktop/target/debug` is the default), and `PAROUSIA_BUILD_DIR` to an extension build made outside a synced folder. `discord:verify` takes Discord's pipe up to its number: `$env:PAROUSIA_REAL_DISCORD_IPC_DIR = '\\.\pipe\discord-ipc-'; bun run discord:verify`. `desktop/scripts/verify-windows.ps1` checks Desktop's tray, start at login, single instance, CLI pipe, and port, using the real release build and the real Windows tray (see `desktop/README.md`). ## Themes -The popup and dashboard come in three themes, chosen in Settings > Appearance: Atelier (the default, Parousia's own palette), Botanique, and Monolith. All of them live in `src/shared/theme.css` as CSS custom properties, in two layers. Each theme block sets the same full set of primitives (backgrounds, text, accent, status colors, focus, control outlines, radii), and a shared block derives washes and lines from them with `color-mix()`. Components use tokens only; `scripts/contrast.test.ts` fails on a color written anywhere else. A theme applies through `data-theme` on ``, or on any element inside it, which is how each theme's preview is drawn in its own colors. +The popup and dashboard come in three themes, chosen in Settings > Appearance: Atelier (the default, Parousia's own palette), Botanique, and Monolith. They live in `src/shared/theme.css` as CSS custom properties, in two layers. Each theme block sets the same primitives (backgrounds, text, accent, status colors, focus, control outlines, radii), and a shared block derives washes and lines from them with `color-mix()`. Components use tokens only: `scripts/contrast.test.ts` fails on a color written anywhere else. A theme applies through `data-theme` on `` or on any element inside it, which is how each theme's preview is drawn in its own colors. -The choice is stored under its own `theme` key in `chrome.storage.local`, apart from Preferences, so changing it doesn't wake the background's presence work. `theme.js`, a classic script in each page's ``, applies a copy cached in `localStorage` before the first paint, then storage's answer, then every change from other views. The cache is only a cache: when a browser clears it, storage restores it on the next open. +The choice is stored under its own `theme` key in `chrome.storage.local`, apart from Preferences, so changing it doesn't wake the background. `theme.js`, a classic script in each page's ``, applies a copy cached in `localStorage` before the first paint, then storage's value, then every later change from other views. The cache is only a cache. When a browser clears it, storage restores it on the next open. -`bun run contrast` resolves every theme's tokens the way the cascade does and measures each text and non-text pair the views draw (text, badges and pills, buttons and their hover, focus rings, field outlines, selected states, switch knobs, status dots) against WCAG 2.2 AA; the same check runs in `bun test`. `bun run themes:verify` checks the built extension in automation Chromium: keyboard choice, persistence, the first paint, other views following, previews staying in their own theme, the contrast of every text actually rendered on 11 dashboard pages and 3 popup views in each theme, a focus ring on every Tab stop, and `prefers-reduced-motion`. `THEME_SHOTS=` also saves screenshots. +`bun run contrast` resolves each theme's tokens the way the cascade does, and measures every text and non-text pair the views draw (text, badges, buttons and their hover state, focus rings, field outlines, selected states, switch knobs, status dots) against WCAG 2.2 AA. `bun test` runs the same check. `bun run themes:verify` checks the built extension in automation Chromium: keyboard choice, persistence, first paint, other views following a change, previews staying in their own theme, the contrast of text rendered on 11 dashboard pages and 3 popup views in each theme, a focus ring on every Tab stop, and `prefers-reduced-motion`. `THEME_SHOTS=` also saves screenshots. ## Activities -Activities come from two repositories, each followed at its `main` branch (`activity-sources.json` names the repository and branch) and checked out under `.cache/activities/` by `bun run activities:fetch` (and every build and `activities:check`, first, so an extension is always made from each repository's newest commit; `PAROUSIA_ACTIVITIES_OFFLINE=1` skips the network and uses what's fetched), which records the revision it reached and never replaces a working copy with a failed fetch: Parousia's own ([parousia-project/activities](https://github.com/parousia-project/activities)) and PreMiD's ([PreMiD/Activities](https://github.com/PreMiD/Activities)). Both file one folder per website, `websites///`, and both go through one pipeline (`scripts/activities/`): the same walk, an adapter per source that maps a folder onto one draft, one module (`metadata.ts`) that turns it into the same manifest (`src/activities/manifest.ts`), one catalog, one matcher, one settings model, and one site-access model. A website in both sources (the same folder name) is listed once, and only the implementation chosen on its page runs, the native one until PreMiD's is picked. Nothing is downloaded at runtime. +Activities come from two repositories, both followed at their `main` branch (`activity-sources.json` names each repository and branch): + +- Parousia's own: [parousia-project/activities](https://github.com/parousia-project/activities) +- PreMiD's: [PreMiD/Activities](https://github.com/PreMiD/Activities) + +`bun run activities:fetch` checks them out under `.cache/activities/`. Every build and `activities:check` runs it first, so an extension always comes from each repository's newest commit. `PAROUSIA_ACTIVITIES_OFFLINE=1` skips the network and uses what's already fetched. A fetch records the revision it reached and never replaces a working copy with a failed one. Both repositories keep one folder per website at `websites///`, and both go through one pipeline (`scripts/activities/`): one walk, an adapter per source that maps a folder onto a draft, one module (`metadata.ts`) that turns it into the shared manifest (`src/activities/manifest.ts`), then one catalog, one matcher, one settings model, and one site-access model. A website in both sources (same folder name) is listed once, and only the implementation chosen on its page runs. That's the native one until PreMiD's is picked. Nothing is downloaded at runtime. + +- **Native** Activities export `detect(page, settings)`. They see the URL and title, plus the page data they declare (`media`, `thumbnails`), which Parousia's collector (`src/activities/collector.ts`) reads on sites the user granted. An Activity that declares page data stays off until it's turned on, which asks for its sites. They're bundled through a generated module, `parousia:activities`. A problem with one stops the build, and `activities:check` type-checks each against `src/core/api.ts`. +- **PreMiD's** Activities compile unchanged into `activities/premid/.js` and run on Parousia's `Presence` and `iFrame` (`src/premid/page.ts`). Their `regExp` is the matcher, every `clientId` in their source is kept, and their settings map to Parousia's. Their language picker is fixed to English, since PreMiD translates its strings on its own service, which Parousia doesn't call. Only the `metadata.json` descriptions are translated, in the views' languages, as `activities/descriptions/.json`. Activities that need their own npm packages, name no client id, target API version 2, are on PreMiD's DMCA list, or assign page text to `innerHTML` (VLC, TLX Toki, Weverse, flagged `UNSAFE_MARKUP` in `scripts/activities/premid.ts`) are left out. `activities:check` lists each one with its reason. They're in the extensions only, not the userscript. +- **Packaged** as one `catalog.json`, which the dashboard lists and searches. Manifests are one file per first letter (`activities/manifests/.json`), found from an id alone, without the description and keywords the catalog holds. Each carries its Activity's version from `metadata.json`, which only that Activity's page shows. A text host index (`hosts.txt`) is searched as text, so the popup never builds an object per site. `src/activities/manifest.ts` has the formats and their readers. + +`src/activities/host.ts` runs what both kinds need in the active tab's page, and turns the result into the page the runtime hands the Activity (see `project/architecture.md`, Activity System Architecture). To build from a local checkout instead of the fetched one, set `PAROUSIA_ACTIVITIES_DIR` or `PREMID_ACTIVITIES_DIR`. -- **Native** Activities export `detect(page, settings)` and see the URL and title, plus the page data they declare (`media`, `thumbnails`), read by Parousia's own collector (`src/activities/collector.ts`) on sites the user granted; one that declares page data is off until turned on, which asks for its sites. They're bundled in through a generated module, `parousia:activities`. A problem with one stops the build, and `activities:check` type-checks each against `src/core/api.ts`. -- **PreMiD's** are compiled unchanged into `activities/premid/.js` and run on Parousia's `Presence`/`iFrame` (`src/premid/page.ts`). Their `regExp` is the matcher, every `clientId` in their source is kept, their settings map into Parousia's, and their language picker is fixed to English (their strings are translated on PreMiD's own service, which Parousia doesn't call; only their `metadata.json` descriptions are, in the views' languages, as `activities/descriptions/.json`). Ones that need their own npm packages, name no client id, target API version 2, are on PreMiD's DMCA list, or assign page text to `innerHTML` (VLC, TLX Toki, Weverse: `UNSAFE_MARKUP` in `scripts/activities/premid.ts`) are left out, and `activities:check` lists each with its reason. They're only in the extensions, not the userscript. -- **Packaged** as one `catalog.json` (what the dashboard lists and searches), manifests in a file per first letter of the Activity's name (`activities/manifests/.json`, found from an id alone, and without the description and keywords the catalog already holds), and a text host index (`hosts.txt`, searched as text so the popup never builds an object for every site). `src/activities/manifest.ts` has the formats and their readers. +## Media Presence -`src/activities/host.ts` runs what both kinds need in the active tab's page, and turns what comes back into the page the runtime hands the Activity (see `project/architecture.md`, Activity System Architecture). To build with a local checkout instead of the fetched one, set `PAROUSIA_ACTIVITIES_DIR` or `PREMID_ACTIVITIES_DIR`. +Settings > Privacy has "Show media presence" (`showMediaPresence` in the preferences), off by default. With it on, music or video that was playing in a tab that was shared stays shared while the tab being shared has no Activity of its own: a site without one, one whose Activity has nothing to show, or a browser page. + +- **The order** is the tab's own Activity, then kept music or video, then the Default Activity (`PresenceRuntime`, its `media` hook). +- **What counts** is a tab whose Activity is on, presents as listening or watching or has an end time (`isMediaActivity`), and has sound playing, which the browser reports as `tab.audible`. A page can't claim it. A muted video or a video with no sound doesn't count. A paused tab stays remembered and counts again when it plays. +- **Which tab** is the one shared most recently (`MediaTabs`, `src/core/media-presence.ts`), not the one that changed last, so two players never trade places. Tabs are remembered only while they are the one shared, so a page's music is never shown without having been looked at. Closing the tab, stopping the sound, turning the Activity off, or turning the setting off ends it. +- **How it is read** is the same way as for the tab shared: `PresenceRuntime.detect` after the same switches, and `PageHost.peek` for what the tab's scripts last reported. Nothing is injected into a tab nobody is looking at, and an Activity that is off is never run (see `project/threat-model.md`, Disabled Activities). +- **A tab that is not shown** reads nothing, by default: the collector and the PreMiD runtime both pause while `document.hidden`, so a song skipped there would never reach Discord. The scripts of a remembered tab are told to keep reading (`PageHost.keepReading`, the `background` message), once a second as ever, and told to stop when the tab is forgotten. A script is told where it stands whenever it connects, so none stays stuck reading after the background restarts. +- **When the background restarts** (MV3 stops and starts it), the remembered tabs are written to `storage.session` (`mediaTabs`: tab numbers and nothing else, which last as long as the browser is open) as they change, and put back before they are first needed. Tabs that closed meanwhile are dropped when looked at. Off, nothing is written or brought back. +- **The popup** shows what is being shared, and beside it whether the current site has an Activity of its own, so it can be turned on or allowed without turning Show media presence off. `UiActivity.kept` says the music or video comes from another tab; `src/shared/site-offer.ts` decides what the popup says about the site. +- **Private tabs** follow Settings > Privacy > Private windows by their own flag. A kept tab that is private and paused keeps nothing. +- **Away from the browser**, sound in the kept tab keeps presence going, like sound in the tab shared. +- **Several browsers**: each sends an ordinary presence, and Desktop shows the one that changed most recently. Desktop is unchanged. + +The tests are `src/core/media-presence.test.ts` (selection, order, restore), `src/core/runtime.test.ts` (order), `src/activities/host.test.ts` (`peek`, `keepReading`, startup, turn-off), `src/activities/collector.test.ts` and `src/premid/page.test.ts` (reading in a tab that is not shown), and the "Show media presence" tests in `src/platforms/background.test.ts` (transitions, several tabs, restarts, Activities that are off, private tabs, being away). `bun run activities:verify` runs the whole path in a real browser with a tab that really makes sound; headless Chromium never hides a tab, so the tab switch is played back into the extension's own world (`setHidden` in the script) and nothing else is simulated. ## Languages -The popup and dashboard are in English, German, French, Japanese, Romanian, Russian, Swedish, and Simplified Chinese; Settings > General chooses one, and "Automatic" follows the browser's. `src/core/i18n.ts` holds the mechanism: English is the string written in the code (`t("Show {name}", { name })`, `tn(n, "{n} Activity", "{n} Activities")` for plurals, `msg("…")` where a string is defined away from where it shows), so English costs nothing to load, and every other language is `src/locales/.json`, mapping each English string to its translation, which a view fetches once when it opens (`src/shared/language.ts`). The fixed text of `popup.html` and `fullscreen.html` is translated the same way, by its words, with no markup. A change of language reloads the other open views. Activity names and descriptions come from the Activities themselves, except PreMiD's descriptions (see Activities). `scripts/i18n.test.ts` finds every marked string and every line of fixed page text, and fails when a language lacks one, keeps one the code no longer uses, changes a `{name}` a string fills, or lacks a plural form its language has. To add a language, add its code to `LANGUAGES` (`src/core/i18n.ts`) and its name to `LANGUAGE_NAMES`, then write its file; the test says what's missing. +The popup and dashboard are in English, German, French, Japanese, Romanian, Russian, Swedish, and Simplified Chinese. Settings > General chooses one, and Automatic follows the browser. `src/core/i18n.ts` holds the mechanism. English is the string written in the code: `t("Show {name}", { name })`, `tn(n, "{n} Activity", "{n} Activities")` for plurals, and `msg("…")` for a string defined away from where it's shown. English costs nothing to load. Every other language is `src/locales/.json`, which maps each English string to its translation. A view fetches it once when it opens (`src/shared/language.ts`). The fixed text of `popup.html` and `fullscreen.html` is translated the same way, by its words. A language change reloads the other open views. Activity names come from the Activities themselves, except PreMiD's descriptions (see Activities). -**Why not the browsers' own `i18n` (`_locales`)?** It was weighed against this and not adopted (measured on the current strings): +`scripts/i18n.test.ts` finds every marked string and every line of fixed page text. It fails when a language lacks one, keeps one the code no longer uses, changes a `{name}` that a string fills, or lacks a plural form its language has. To add a language, add its code to `LANGUAGES` and its name to `LANGUAGE_NAMES` (both in `src/core/i18n.ts`), then write its file. The test lists what's missing. -- It follows the browser's interface language and nothing else, so Settings > General's choice of a language (and ``) couldn't exist, and Automatic would be the only mode. It has no plurals (a message per form, picked in code anyway), names every message by an id of letters, digits, and `_` (so the 260 strings and the 225 places that use them would need ids, and `t("Retry Connection")` stops reading as what it shows), and can't translate a page's HTML, so `translateTree` would stay. -- It needs a complete `en` file as the default locale, and the browser keeps the whole active locale and the default in memory for the extension. The same strings in its format are 149 KB across English and the five other languages against 96 KB here (about 25 KB a language, plus 26 KB for English), and the packed size is no better: a zip compresses both alike. -- PreMiD's 1,400 translated descriptions can't go in it at all: they would all be held in memory for as long as the extension runs. They stay in `activities/descriptions/.json`, fetched when a view needs them. -- `_locales` can't be compressed, deduplicated, or shared between languages, since each locale file must hold its own messages, and the browser reads it as it is. What it can get is what the build already does for these files with no runtime cost: `scripts/locales.ts` minifies each locale and leaves out strings that are their own translation, which takes the six files from 118 KB to 110 KB. -- What native `i18n` would add is a translated extension description in the browser's extension list. It's one sentence, and it would need a `default_locale`, placeholders in both manifests, and a special case for the userscript's header, so it isn't done. +**Why not the browsers' own `i18n` (`_locales`)?** It was measured against this and not adopted: + +- It follows the browser's language only, so Settings > General's choice (and ``) couldn't exist. It has no plurals, and it needs an id made of letters, digits, and `_` for every message. The 260 strings and their 225 uses would all need ids, and `t("Retry connection")` would stop reading as what it shows. It also can't translate a page's HTML, so `translateTree` would stay. +- It needs a complete `en` file as the default, and the browser keeps the active locale and the default in memory. The same strings in its format are 149 KB across English and five other languages, against 96 KB here. The packed size is no better, because a zip compresses both alike. +- PreMiD's 1,400 translated descriptions would all stay in memory for as long as the extension runs. They stay in `activities/descriptions/.json` and are fetched when a view needs them. +- Locale files can't be compressed, deduplicated, or shared between languages, since each must hold its own messages. `scripts/locales.ts` already minifies them and leaves out strings that are their own translation, which takes the locale files from 118 KB to 110 KB. +- Native `i18n` would add only a translated extension description in the browser's list. That's one sentence, and it would need a `default_locale`, placeholders in both manifests, and a special case for the userscript header. So it isn't done. ## Compatibility -`src/compat/discord-rpc-extension.ts` implements Discord-RPC-Extension's presence protocol (Chromium and Firefox only), so Parousia's Activity detection can drive Discord Rich Presence through that project's existing Desktop bridge without needing Parousia Desktop. It's fully wired but inert until `DISCORD_RPC_EXTENSION_CLIENT_ID` is chosen (see `project/roadmap.md`, Compatibility). The same file maps an Activity to Discord's fields (`toDiscordPresence`) with the rules Desktop's Discord adapter uses, both tested against `adapters/discord/activity-mapping.json`. See `project/architecture.md`'s Compatibility Layer section for the full protocol writeup and how Parousia coexists with Discord-RPC-Extension's own server. +`src/compat/discord-rpc-extension.ts` implements Discord-RPC-Extension's presence protocol (Chromium and Firefox only). It lets Parousia's Activity detection drive Discord Rich Presence through that project's existing Desktop bridge, without Parousia Desktop. It's wired up but inert until `DISCORD_RPC_EXTENSION_CLIENT_ID` is chosen (see `project/roadmap.md`, Compatibility). The same file maps an Activity to Discord's fields (`toDiscordPresence`) with the rules Desktop's Discord adapter uses. Both are tested against `adapters/discord/activity-mapping.json`. `project/architecture.md`'s Compatibility Layer section has the protocol and how Parousia coexists with Discord-RPC-Extension's own server. -`src/compat/malsync.ts` takes what the MAL-Sync extension recognizes on a page (title, episode, cover, progress) as the Activity, when it's turned on in Settings > Platforms (it's off by default). MAL-Sync doesn't use Discord-RPC-Extension's app: it answers that extension's browser extension when asked, so Parousia asks the same way (`runtime.sendMessage(, { tab, info })`) for the shared tab, and the reply, parsed and bounded like a PreMiD Activity's report, goes into the runtime through `RuntimeOptions.external`. Only a tab number is sent, nothing new is listened for, and no permission or `externally_connectable` entry is added. It asks when the shared tab's address changes (four times, over 25 seconds, where MAL-Sync has nothing) and every 15 seconds while MAL-Sync has something to show; with it off, or nothing to share, nothing runs. It's tested in `src/compat/malsync.test.ts` and `src/platforms/background.test.ts` against the shape of MAL-Sync's reply (from its source and shipped build), not against a live MAL-Sync (see `project/compatibility.md` and `project/roadmap.md`). +`src/compat/malsync.ts` takes what the MAL-Sync extension recognizes on a page (title, episode, cover, progress) as the Activity, when it's turned on in Settings > Platforms. It's off by default. MAL-Sync doesn't use Discord-RPC-Extension's app. It answers that extension's browser extension when asked, so Parousia asks the same way (`runtime.sendMessage(, { tab, info })`) for the shared tab. The reply is parsed and bounded like a PreMiD Activity's report, then goes into the runtime through `RuntimeOptions.external`. Only a tab number is sent, nothing new is listened for, and no permission or `externally_connectable` entry is added. Parousia asks when the shared tab's address changes (four times over 25 seconds, where MAL-Sync has nothing) and every 15 seconds while MAL-Sync has something to show. With it off, or nothing to share, nothing runs. It's tested in `src/compat/malsync.test.ts` and `src/platforms/background.test.ts` against the shape of MAL-Sync's reply (from its source and shipped build), not a live MAL-Sync. See `project/compatibility.md` and `project/roadmap.md`. ## Popup -`src/popup/` is the toolbar popup shown via the `action` key in each extension manifest. It shows the Activity the background script is sharing, which the background pushes over the popup's port with every change, so it's exactly what reaches Desktop (a PreMiD Activity's report included) after Privacy settings. Its footer shows the Desktop connection, and when something's wrong, what to do about it (start Desktop, allow this build with the exact origin, or update a mismatched version). The userscript target has no popup, since it has no browser action to attach one to; its manager's menu has the status command instead. +`src/popup/` is the toolbar popup, shown through the `action` key in each extension manifest. It shows the Activity the background script is sharing. The background pushes that over the popup's port with every change, so the popup shows exactly what reaches Desktop (a PreMiD Activity's report included) after Privacy settings. Its footer shows the Desktop connection and, when something's wrong, what to do about it: start Desktop, allow this build with the exact origin, or update a mismatched version. The userscript has no popup, since it has no browser action to attach one to. Its manager's menu has the status command instead. + +When the Default Activity is what's shared, the popup still shows the tab's site Activity below it, if the site has one. It's offered when it's off or can't run here, and noted when it's on with nothing to share yet. The decision is in `src/shared/site-offer.ts`, and `src/popup/popup.ts` renders it. ## Fullscreen -`src/fullscreen/` is a larger, standalone presence view opened as its own tab via the popup's expand control (`chrome.tabs.create` to `fullscreen.html`, not a popup). It renders the Activity the same way the popup does, through `src/shared/presence-view.ts`; see `project/architecture.md`'s "Full-Screen Presence View" section. +`src/fullscreen/` is a larger, standalone presence view. It opens as its own tab from the popup's expand control (`chrome.tabs.create` to `fullscreen.html`, not a popup). It renders the Activity the same way the popup does, through `src/shared/presence-view.ts`. See `project/architecture.md`'s "Full-Screen Presence View" section. + +It's split into pages, one rendered at a time and addressed by the URL hash: + +- **Overview** (`#overview`): the current Activity, Parousia Desktop's status, and its version. +- **Activities** (`#activities?q=…&filter=…&page=…`): the catalog, searched, filtered, and paged, so only one page of cards is in the DOM. It's sized for PreMiD's 1,400+. `#activities/` is one Activity's page, with its switch, version, and settings. Enabled Activities come first, each group by name. +- **Settings** (`#settings/`): the same pages as the popup's Settings. + +The Filter button beside the search offers Enabled, Disabled, Parousia Activities, and PreMiD Activities. Choices within a group add up, and the two groups narrow each other. "Enable or disable all…" applies to everything the search and filters match. It asks a second time, and for enabling it warns that the browser will ask for that many sites in one prompt. A decline leaves those Activities off. The logic is in `src/shared/activity-list.ts` and `src/shared/activity-catalog.ts` (`bulkPlan`, `enableAll`, `disableAll`), tested without a DOM. `bun run activities:verify` drives the page in a real browser. -It's split into pages, one rendered at a time and addressed by the URL hash: **Overview** (`#overview`: the current activity and Parousia Desktop's status and version), **Activities** (`#activities?q=…&filter=…&page=…`: the Activity catalog, searched, filtered, and paged so only one page of cards is ever in the DOM, sized for PreMiD's 1,400+; `#activities/` is one Activity's page, with its switch and settings), and **Settings** (`#settings/`, the same pages as the popup's Settings). On the Activities page, enabled Activities come first and disabled ones after, each by name. The Filter button beside the search offers Enabled, Disabled, Parousia Activities, and PreMiD Activities (choices within a group add up, the two groups narrow each other). "Enable or disable all…" under the search applies to everything the search and filters match, asks a second time, and for enabling warns that the browser will ask for that many sites in one prompt; a decline leaves those Activities off. The logic is in `src/shared/activity-list.ts` and `src/shared/activity-catalog.ts` (`bulkPlan`, `enableAll`, `disableAll`), tested without a DOM, and `bun run activities:verify` drives the page in a real browser. Overview mentions Discord-RPC-Extension's app only until Parousia Desktop is connected; its status stays in Settings > Platforms. Diagnostics aren't in the extension at all; they're Desktop's (its tray and `Parousia-Desktop status`). Desktop only accepts setting changes from a connection it knows is this OS user's; otherwise Settings points to `Parousia-Desktop set` or Desktop's console. +Overview mentions Discord-RPC-Extension's app only until Parousia Desktop is connected. Its status stays in Settings > Platforms. Diagnostics aren't in the extension at all. They're Desktop's, in its tray and `Parousia-Desktop status`. Desktop accepts setting changes only from a connection it knows belongs to this OS user. Otherwise, Settings points to `Parousia-Desktop set` or Desktop's console. diff --git a/browser/bun.lock b/browser/bun.lock index c4d4cd1..7c6c605 100644 --- a/browser/bun.lock +++ b/browser/bun.lock @@ -7,9 +7,9 @@ "devDependencies": { "@fortawesome/free-solid-svg-icons": "^7.3.1", "@types/bun": "^1.4.4", - "@types/chrome": "^0.3.6", - "oxfmt": "^0.74.0", - "oxlint": "^1.89.0", + "@types/chrome": "^0.3.7", + "oxfmt": "^0.76.0", + "oxlint": "^1.91.0", "playwright-core": "^1.64.1", "web-ext": "^10.8.0", }, @@ -69,81 +69,81 @@ "@mdn/browser-compat-data": ["@mdn/browser-compat-data@8.1.4", "", {}, "sha512-Cgp3OP3u9x57kT1sZPI115SP5H1IyaBhdDPnvnHRYZ1988kW83wuqcIdcMinLJXlMKOL5Y2cufWHzngh5cVtow=="], - "@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.74.0", "", { "os": "android", "cpu": "arm" }, "sha512-xxQwrf5EPI5zxvuCTW8r6tzCTjPQ+h6+HqJ0iRKRy2zS1yBllt/xLVjoIyUc+FnR7g0a5g1SZv2yyDYhTItLbA=="], + "@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.76.0", "", { "os": "android", "cpu": "arm" }, "sha512-z8x4kittQLPsrJWmfoIJyYqs2gNwceGShoUqAJdFRPw3K4kkkKCFHh3Cr4NFRvZb7DPfDS3+JfBjSm3OIyQaJQ=="], - "@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.74.0", "", { "os": "android", "cpu": "arm64" }, "sha512-FJW3sATVvrWbV64al8xofCPZj4500Z/1W0ad7Tg1rcCUyh0EMbuSrsf3jsZS7CEbwQ5fQ0mRhmkc129GFgofSQ=="], + "@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.76.0", "", { "os": "android", "cpu": "arm64" }, "sha512-Zj9fEQhQSKGj8ZTB+X4q4ho4545xWf7qsvJpwREWnBz5BATEFYtStKRgiwYOZvxQ7ORlBEgSj7pmDzuljfV1mQ=="], - "@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.74.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-TfmNKBD30dGyMu9GCLiaw2rt/z7fms9LS+5cKcNOyWst0QgAs8oZs6wPxMbVaaDVE0/PCdCosgWM1vbu6f5NUg=="], + "@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.76.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-jZy8GpUXaWpic5JPMAvLmaBz95Sx0naZl6hptBPLOMiYmZYiME7jAt6pv8o/tjQqPNWKb+7jKzZhrYx6UqM5MQ=="], - "@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.74.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-5Usf8+DfC4Q3o/MD8FkN47GrI6y0KbhQ4KhZ2HGzMZcXjcW1AeldwbUn51aKih+1TVuJFF9qkNm6X1nzm6NYng=="], + "@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.76.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-U59+a9lVpoRp9enRhTE9GssL3qB1k09CYagRzTfs3dfknopMYV0x0xHZv7Pls3SNMqHlyHR+ufmY76CYafQoLw=="], - "@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.74.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-eL+1O3gykw1XihbZh2MRAciQvU2988LByrnjhyo/dmNG74X4oZ7XzigRoWPRFLfJCp8hzRkp/LbEhwe7uuT2eA=="], + "@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.76.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-J1R3YJHPdQJ2RQvzMdTVDWyizhihGiRGGAeEZxtGp629j5pcT5ypSLSiBflopD7o7tmiMD+xlNfhIVmjcHKMVQ=="], - "@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.74.0", "", { "os": "linux", "cpu": "arm" }, "sha512-Xt0QtO2hJ4stnul8IL4LJGVLyp0xnc6ccN9fZ30yuubv8FWSRYxWwd1Za62KsEqAfmPSazoS/cLSUUJpja6npA=="], + "@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.76.0", "", { "os": "linux", "cpu": "arm" }, "sha512-x9qTg6zHoqeyzmFVlIjSb9WlhZdoXaayMTeQeDeUEfKA484AgPJz7f9chLjDMONA6wUUX0FJxnVHsYgX5Zv0+g=="], - "@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.74.0", "", { "os": "linux", "cpu": "arm" }, "sha512-/4wYQ0gZl4vUR0QoBTGaay73FmQ1GAjUa9z9101TR2xbGNrg4a+grazlR0yzEOe3/E+PJr5BGfj66MMzm/54vg=="], + "@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.76.0", "", { "os": "linux", "cpu": "arm" }, "sha512-303gbamm7NDllTtkeaX+8F5Da+KcSBr64mqELQEFg9XgnjfLX3YBCHUcOfgIlVTSybesy43eoeKai8oGr0P6UA=="], - "@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.74.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-846bKzF+HJd+JkOFh3rxzmYvSq4Cm+GMT+p+mW7S13ZYo6GAAGv8bL8cAOi/XcdeMqxEJDCIMTVQLVBXHMCdig=="], + "@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.76.0", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-j3UAXzCJoWX9bZLaICj6DfwkI/2fzja9RpiCIbIN+2CQAcKoY+5SH5pQUcECvn32mQm17NSPE9YqTAwYx1seZg=="], - "@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-linux-arm64-musl@0.74.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-nI5FJwZ4Flo6CBdscpwxymZXxO3m3IErQJX55ZS6h+ObfGXu8FostL85L/RWPFaCLnIVE4/WfLw+2q8XvVEeUA=="], + "@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-linux-arm64-musl@0.76.0", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-qFZqWVkEzuxWMtUkCtHxsnohXHnUMBQr/ZIxF0KmlCSt8de/bc1lbpVgpqjb3QxCADQHG/O1s3JcowcBF2sqdw=="], - "@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-linux-ppc64-gnu@0.74.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-BoQYKuqUdsKAFAkK6DLBvkdv4+t0hppSm79sB0wIcE2o/eOwNj+6Z3OlKY4q3Eta/tlssP65FaS9vHn8TeF7vQ=="], + "@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-linux-ppc64-gnu@0.76.0", "", { "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha512-ROiAid0UH2GN5lMMX2JTgKlOKx1rN+6a1WxIuBsU3j5A3MuB9U5XkREMW76XBbAImnH45mfOCFcSIwb+drcVYg=="], - "@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-linux-riscv64-gnu@0.74.0", "", { "os": "linux", "cpu": "none" }, "sha512-FSroRrM12+jCdSQklF9aOxsKpI6wFs4ZCo/1cSYG80RWZS6z4LV+l9tXRMT8lDGu+yohIZBwi9M76FzGPFDE2A=="], + "@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-linux-riscv64-gnu@0.76.0", "", { "os": "linux", "cpu": "none", "libc": "glibc" }, "sha512-Oyd/9ObdM2RYkZ7yzF/GyvVdbNgJcRG8BFVwnAVo3ooqzaem4E2p5eTIGB09FecQD+Q5HQEANOTEnIZTO6rBAQ=="], - "@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-linux-riscv64-musl@0.74.0", "", { "os": "linux", "cpu": "none" }, "sha512-0VLQD0dhGBLY9Ik/w+otMvD81D0YXi4VDwql65macV+O9UzmSWmUr6CKf+dMtysDeC0PnG3y6kBkRO08BJx52g=="], + "@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-linux-riscv64-musl@0.76.0", "", { "os": "linux", "cpu": "none", "libc": "musl" }, "sha512-86DOpmPDR5UzHSOB8y5HlOpYAIBtMx+6L72IyousNx54q1Kz61aykB4ScovFYivZUak+7Ww6tPBUjarluzYKLw=="], - "@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-linux-s390x-gnu@0.74.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-6X7BbZNz34+OHM6Oqjf6TRcUyRn6aRcB4VtIDZAF/uQRyeVhg+G2hv6MlMvmnRekVSyTJ/8rG/u8W2dRFW6glg=="], + "@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-linux-s390x-gnu@0.76.0", "", { "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha512-u6omjjFooKfnHLBI+3UtBVInAeuEhoM/RAIw/OiFop2QQgOan5zDfqPR6guMaylt68L60kV+by07Ibp87KDjrw=="], - "@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.74.0", "", { "os": "linux", "cpu": "x64" }, "sha512-4kYIQK53yJXrxwxSzx8H2bojlf6/KezLGYLRXzV9QCCkoiCsvBTCid9Bg83dUPTLPa3g9K0730f6MKDbck1+OA=="], + "@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.76.0", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-L0/hW1MdMrgsvuLGp9YEQOYOGj5xPHa8wVRtybdd5av03PV4qSpAq3pyfC7sn7UCA8ynRhMRTAa9Kr9nV4LGZg=="], - "@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.74.0", "", { "os": "linux", "cpu": "x64" }, "sha512-MfWz4wDREjp/JQDmuxtKieix4FHGa1z5rBvB3betdcPwZvf5fqeQrlCm1mmoyuUVQOh9Pt3M61HwN94kJCxw7Q=="], + "@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.76.0", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-JNk/7HaPDJjy5kih3vq6b71Qif3tHx1ZFACGBzeHeNzyKaIpar4eFGya89GR398K2rwX0eEVmEq1npBPlEkkmg=="], - "@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-openharmony-arm64@0.74.0", "", { "os": "none", "cpu": "arm64" }, "sha512-6rmAApkq5s1kbDjvNI6Nl5A+JqQkLORb2sR941pf5HWsrd01WGKyagK/B4vX9+kh1FfvRkNgEu59FHvVk4H8cQ=="], + "@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-openharmony-arm64@0.76.0", "", { "os": "none", "cpu": "arm64" }, "sha512-MDLrOQPXDuPKvPUCvpP3hC6kO72dsYxfpYiR08Nf5DiM75M0d8+D26JwT4uHDf0bcflvlGHcd58Hn2HpxkHUUQ=="], - "@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-msvc@0.74.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-+5SpRUnZNGeXTyumHnpHa791tQtt04qZs076WT8eTcGF2OJ631VLnf7S0kQSPuDG+PtJM0phadEB2WAr5n1w9g=="], + "@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-msvc@0.76.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-2CcICDrQKqMAOFuzmts/8Ov5iKb+DW/QrW4MFsl2bnRg86uoiUvtqUkHqNSY19Shegc8pBHiXMSEHDjIg94o0A=="], - "@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win32-ia32-msvc@0.74.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-1Fg+wYBO3Dsti1QX+/6EYHjeQzLC84tLOAqPu/r7ah3UJlUs9C/DB703Ay9Vcg+8VMzqZA2P5VGhzJraVUD4OQ=="], + "@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win32-ia32-msvc@0.76.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-NjZLJg+tQpMWVSyeWBBKCpib7H/uLq84ZzxCvY5eqHzSaItuzCECGA9MBiZwmW8fnkBIfppg49Ib//LSCGAp8Q=="], - "@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.74.0", "", { "os": "win32", "cpu": "x64" }, "sha512-y9jXUgPBm2TZIWbQhMYRRYAQM57+r4fbykgc+j24ICIIZl+pcuoNhnq1CRGm3oFiHnEUnZO00qOtSPGQdJ2ziQ=="], + "@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.76.0", "", { "os": "win32", "cpu": "x64" }, "sha512-0vCMaX/qloc7uaKBDRh+62SBW8EqmhS7c8/al+PxD594ao4lyEWdcoEmVoBgnCNVW07GDpg+9uPV7x6ta9mljw=="], - "@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.89.0", "", { "os": "android", "cpu": "arm" }, "sha512-Pflpba5F3gRAQ12sWglRxvWTHEdAusNDvmi4Y5N1T5SY1AGkM7AixOnET8qkrnLJ/F32qAlNokO6eCknT8tmnw=="], + "@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.91.0", "", { "os": "android", "cpu": "arm" }, "sha512-eOqJUUS1MCqIoUUxMIkuwaqIdKaHr1SXYA0CQI95UUrF8jwQylQH33bBmnqhZfvWXKlRB2Ylx/+Sbk/ctEqzZQ=="], - "@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.89.0", "", { "os": "android", "cpu": "arm64" }, "sha512-dYmyD1x7LaPlb79vZWUcpTShk8dI9z1I+IubtqrBxWNJaDhQdPHwcsvg7q5StTU4xWyd9AwPfLaTYFZY8NZgtQ=="], + "@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.91.0", "", { "os": "android", "cpu": "arm64" }, "sha512-vIJU4lRxK0EhbBt+iR3rkq3pio4I+V5Gshwjei3plNjN+CIq0WxWHzYVI06J9KN8Ar3hyNSFtzJAjVRLZOYpjg=="], - "@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.89.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Z/oxOPiIqiS7fItRdxaaOEC+6GD3OpGi0IxoR0dMefzQHolsKLzScw2DNcu/5gUPok3tv+G9mslvYB5bo3i0qg=="], + "@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.91.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-tLy76MurwAOpQt5QVMkJUgexBSWhB7qdvAYb14bc0xntZS6f55aKicbZoxZ/QlmAbnrdlXeD5+IjwY8EZ9RWTg=="], - "@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.89.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-eAjTkHSjAxrdCPJxO6y5sPQL5pYLKb2kvxZz9UU7tXnOZk9I/HLtkvx9S7GHY883k+AmL/eC7mqFt+w7WCwk0w=="], + "@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.91.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-zPeMmjAqm5vXxbTp/JqYuc9gGSbUuEaeCAkFHB4TCRLTlfJGD//Fkx03YvZHCHZJ7ideLiiLcae+3f2I27qnaA=="], - "@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.89.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-0lNCA9Tl1n1FKpqy2/9ckp0kIuSrtJ/l9bMRgaEhOtM7TsOHshFuwOcvW8oA9teXLMOJT61LjEKWiaHDFGxF/w=="], + "@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.91.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-psOR9+xGMXn0hj4KY5M2kjSQ1n0TCMdYbPOraoV0iQyl7mw2oBBYGUM2+ma40m1YLVrktTBOta4FjrmcOHDhrg=="], - "@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.89.0", "", { "os": "linux", "cpu": "arm" }, "sha512-OTFEvi9W+JczaZD1Caj17SGCoW8H7TE+fvx0D7ATEWa1Lohn91UMxFQ6r145SiGy/yCxeIwptMys/RAM7gSVSQ=="], + "@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.91.0", "", { "os": "linux", "cpu": "arm" }, "sha512-1PNA1j4ETxawvxfz6ueDxWgQgWkXPbv44DWZmC7LR07GqojGFDOwWbosOT6/AYiJr7zMXEhn2dPWMkyFFOFpUQ=="], - "@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.89.0", "", { "os": "linux", "cpu": "arm" }, "sha512-fRxgNHvBLswj6MrhW2uBq5UDhPRQlCbHeq/Nf8yuG9zOxhDsXqX/mi2PX1axgsQxMm88el7HLiJAzglAnflYxw=="], + "@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.91.0", "", { "os": "linux", "cpu": "arm" }, "sha512-jcNePVpca37lTbHmiPMnVbPAAW0rH9kAoDjsDv6vESEX9pzazIR1q5SyYuc1rQzdjHtc2VVCDN9jDh6tHcOHyA=="], - "@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.89.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-v9ENzHvwrQoYSWTtviH1pOYc7R9UovDxVofnck50cNmPihRRTcrg5X0UlRbLOZ7IVtxPOlh2hb7kDO+FpE8SfQ=="], + "@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.91.0", "", { "os": "linux", "cpu": "arm64", "libc": "glibc" }, "sha512-TJi78UX6R+9qZ23ZKtzN6adfW83bjY0NXsCRMBRH6H7IizaMXmZbdRAtjedMkx77bT46YQH0csawsY9lwha8MA=="], - "@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.89.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-vfffe8mQ484AzVadlUOFpgL+JDwhvs9hrzxTgQP1FVfi4ZEUUYeffXlzC9dFV7Dgnu5s/KrNKvfmG6HxBd/ISQ=="], + "@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.91.0", "", { "os": "linux", "cpu": "arm64", "libc": "musl" }, "sha512-OowlLroUTzKq5OBvbu6iegch8SJ2DivXFCukzPWURwvcJhMj7/P0CUGH5qrDlxT1Kh48dcxqYqrvE8qK6xTLKQ=="], - "@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.89.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-Buonlp4hVS7RGNP5M7bPpGNQrenyzA2C64JcO/oz9C1c6dGOXJ7VEAnaiAMY7voou0JYyCJdvDVlFQc5DZX3DQ=="], + "@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.91.0", "", { "os": "linux", "cpu": "ppc64", "libc": "glibc" }, "sha512-QF/5Ge8yGpWg5s4awMNHfVKh1WOmk591Qg082i6CHenXYBa+W1E5RwWZXaKUOw4Ko7CCjqg3TfBc0AzhnqblYg=="], - "@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.89.0", "", { "os": "linux", "cpu": "none" }, "sha512-1eVwJJrJ3lYIPT+cm7BcBBZZXY6IQZP/oyonaruTor/MrVyWOpvnwt1oD5CLdsHg5aVBIxXodQSvt+1gK6ck5w=="], + "@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.91.0", "", { "os": "linux", "cpu": "none", "libc": "glibc" }, "sha512-dXlsKlNhzJQX1nageGKnvWe1D7uTng249hQM80CG/YPZ8F/VZHbxVLhImgurdWBOmu86XOemValLjrW6QIOM/Q=="], - "@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.89.0", "", { "os": "linux", "cpu": "none" }, "sha512-fRQQsKUGShdEL5Fl9o9uhj3grkZbeXKLv0icQ5tspUCNYSDy8wzzEcP1WC2bKdTQ0rSszbKlO3iiHORxV22DLg=="], + "@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.91.0", "", { "os": "linux", "cpu": "none", "libc": "musl" }, "sha512-tznkj5VrWNRUfymkaLcJetgMLbP9suL5ob/m7j0Fdbnm5u3Li/Ezo/YcBixiuwdL1sg0oGpyTe86It0J6T+Lxg=="], - "@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.89.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-dEtYjIy6+fHcjKklsmtmMkZRhwHr2UbzjmpvuPtQYSeN9awQ2hx5JLms5Wvri+8P/NZtD8v5hfgHALUql+/Ycg=="], + "@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.91.0", "", { "os": "linux", "cpu": "s390x", "libc": "glibc" }, "sha512-sNvfLiUYQkVsLNUgIW24AEYTHSd2zZ1vAxXssPdjuQHTtCpRvQihYri6d5z5FY7w/QrcnB5+g9E+/sqmZq8tfA=="], - "@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.89.0", "", { "os": "linux", "cpu": "x64" }, "sha512-hqjwIj5KOYM8Wjef/p7IruNi1iByLhSzbMBk62y22P/E8q7Jj0Pp+DeUTKTRYyZYCDtU1wEGlnWOnttHbyNIww=="], + "@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.91.0", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-eA25ETvimhUZ89y5BcunNY7yv7qwG2I7V7dFQAU+mIEqZ57gBCXdIERl0yXOEt43zjsw0yK2gRKTc+twF706wQ=="], - "@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.89.0", "", { "os": "linux", "cpu": "x64" }, "sha512-iAQN3e6o9UgUCcdGwqRx/jYcKbG3HK7ur3rH6lTqVcQeNGZ85AeWIg6cgn/edwFQ0ofEZZItMwkzyCVTahnvEA=="], + "@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.91.0", "", { "os": "linux", "cpu": "x64", "libc": "musl" }, "sha512-4hZ4Z9K+OkcTpAHDoUTMg/8MModbM0aocrl9KnGzp9h5iKqjrXraEUZorYoVCT7xoK93CAHXgTndxRBrOjH/fA=="], - "@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.89.0", "", { "os": "none", "cpu": "arm64" }, "sha512-MNxjEByz3N/7Q4qFQuPWvc14TpN9LoD3pECEDsJTZbP/wyB7U+hduUXEl7QAbbgVezFwsb9sWtNUO6XVBndOhg=="], + "@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.91.0", "", { "os": "none", "cpu": "arm64" }, "sha512-gtqn4b0kLpGe46Qh7NHiR86wZpd+TLaesO106s7V3RG33r63VB94LW5qPKEDJX64osh3xfjnPFn1M0484bC7wQ=="], - "@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.89.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-xxe+i9wfuFso/VnoL4mfj0UlzE+cfCFiUB06vkXCMyQdgVVmItF5FfAF4tATAktSU6uHruWR+FjqvAT9cHZZzg=="], + "@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.91.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-KQItBdsyHN28U3z/bEek6h9pvG3Uqv564QYO8K1bE/V7YRZgpHlRnfNKVPHkk4sfYKyPzEjCgW80QkImOLvJog=="], - "@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.89.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-saFy07cO94E664glwgLmKLI40HgTL1PY86y4T6+ud4niX4H0Kdqjcmqmjps7mQNdBytV5guGbXDdyQtRfeLbLA=="], + "@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.91.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-XFKqbbsQVmTgw+CyBKuzSZtAa45viom1naFfulKmkTFdDyDaBQaBqEz5J61TI8iwBynU+F8q7qPD+9mplZRhEg=="], - "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.89.0", "", { "os": "win32", "cpu": "x64" }, "sha512-hLFJ/o0f/dTJh/EW0vmcbREYSQO9tYgfiAAlsOkiLFiJuRRWvYtFELUXN5o2ijpSo/tlO1n+YlWN58tZwPG18A=="], + "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.91.0", "", { "os": "win32", "cpu": "x64" }, "sha512-DmpK0PthG66Bcz5Y4JqNbzXltzyLQtg3ofYpd25+ejm7kQYUM78VL1uIP/ZFct2781mwUyBX37LatFPCTVp35A=="], "@pinojs/redact": ["@pinojs/redact@0.4.0", "", {}, "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg=="], @@ -155,9 +155,9 @@ "@types/bun": ["@types/bun@1.4.4", "", { "dependencies": { "bun-types": "1.4.4" } }, "sha512-9wkRDXUXK124pEnAutE6n/l18j+i9GC5IAHK8TmX/2nlySETmky0OU6yL5U8pW1AoKh++AN9auDCr647BfurjQ=="], - "@types/chrome": ["@types/chrome@0.3.6", "", { "dependencies": { "@types/har-format": "*" } }, "sha512-NXCrCBefCHCKMVbkaxfBQqyP766Wg85S2FQhixCCxq7AtjJwoEaja2y5NSqCzpihIi9mPqhaF5RuybTnrdYD2Q=="], + "@types/chrome": ["@types/chrome@0.3.7", "", { "dependencies": { "@types/har-format": "*" } }, "sha512-jWZgbHqWbTL1a5+PoyN0OJutNyejWgyZ5MdcvKo6iJE1TNRtXR3FxsC4WzNl52yZWPidfWC8NV/VUNZf+OFKcA=="], - "@types/estree": ["@types/estree@1.0.9", "", {}, "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg=="], + "@types/estree": ["@types/estree@1.0.10", "", {}, "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g=="], "@types/har-format": ["@types/har-format@1.2.16", "", {}, "sha512-fluxdy7ryD3MV6h8pTfTYpy/xQzCFC7m89nOH9y94cNqJ1mDIDPut7MnRHI3F6qRmh/cT2fUjG1MLdCNb4hE9A=="], @@ -165,7 +165,7 @@ "@types/minimatch": ["@types/minimatch@3.0.5", "", {}, "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ=="], - "@types/node": ["@types/node@26.6.5", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg=="], + "@types/node": ["@types/node@26.6.6", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog=="], "@typescript/typescript-aix-ppc64": ["@typescript/typescript-aix-ppc64@7.0.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ=="], @@ -529,7 +529,7 @@ "natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="], - "node-forge": ["node-forge@1.4.0", "", {}, "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ=="], + "node-forge": ["node-forge@1.4.3", "", {}, "sha512-P6wzfh6t70avmV8FrVEAd/36sOPJQ+hkaJVX1Laap9J/77m7M0eyozDvc8SwnDf4P7MP94gwbAAo0rg3YVXT+g=="], "nth-check": ["nth-check@2.1.1", "", { "dependencies": { "boolbase": "^1.0.0" } }, "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w=="], @@ -539,9 +539,9 @@ "optionator": ["optionator@0.9.4", "", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="], - "oxfmt": ["oxfmt@0.74.0", "", { "dependencies": { "tinypool": "2.2.0" }, "optionalDependencies": { "@oxfmt/binding-android-arm-eabi": "0.74.0", "@oxfmt/binding-android-arm64": "0.74.0", "@oxfmt/binding-darwin-arm64": "0.74.0", "@oxfmt/binding-darwin-x64": "0.74.0", "@oxfmt/binding-freebsd-x64": "0.74.0", "@oxfmt/binding-linux-arm-gnueabihf": "0.74.0", "@oxfmt/binding-linux-arm-musleabihf": "0.74.0", "@oxfmt/binding-linux-arm64-gnu": "0.74.0", "@oxfmt/binding-linux-arm64-musl": "0.74.0", "@oxfmt/binding-linux-ppc64-gnu": "0.74.0", "@oxfmt/binding-linux-riscv64-gnu": "0.74.0", "@oxfmt/binding-linux-riscv64-musl": "0.74.0", "@oxfmt/binding-linux-s390x-gnu": "0.74.0", "@oxfmt/binding-linux-x64-gnu": "0.74.0", "@oxfmt/binding-linux-x64-musl": "0.74.0", "@oxfmt/binding-openharmony-arm64": "0.74.0", "@oxfmt/binding-win32-arm64-msvc": "0.74.0", "@oxfmt/binding-win32-ia32-msvc": "0.74.0", "@oxfmt/binding-win32-x64-msvc": "0.74.0" }, "peerDependencies": { "@astrojs/compiler-rs": "^0.4.0 || ^0.5.0", "svelte": "^5.0.0", "vite-plus": "*" }, "optionalPeers": ["@astrojs/compiler-rs", "svelte", "vite-plus"], "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-G4OP7FgwGYZR5ttRpCOOfJdyRsSyvtn34vSXnjDq6Oqed5Dufg5mB44mank+51nAdHOKuTJ0lj0mksY7L+N61A=="], + "oxfmt": ["oxfmt@0.76.0", "", { "dependencies": { "tinypool": "2.2.0" }, "optionalDependencies": { "@oxfmt/binding-android-arm-eabi": "0.76.0", "@oxfmt/binding-android-arm64": "0.76.0", "@oxfmt/binding-darwin-arm64": "0.76.0", "@oxfmt/binding-darwin-x64": "0.76.0", "@oxfmt/binding-freebsd-x64": "0.76.0", "@oxfmt/binding-linux-arm-gnueabihf": "0.76.0", "@oxfmt/binding-linux-arm-musleabihf": "0.76.0", "@oxfmt/binding-linux-arm64-gnu": "0.76.0", "@oxfmt/binding-linux-arm64-musl": "0.76.0", "@oxfmt/binding-linux-ppc64-gnu": "0.76.0", "@oxfmt/binding-linux-riscv64-gnu": "0.76.0", "@oxfmt/binding-linux-riscv64-musl": "0.76.0", "@oxfmt/binding-linux-s390x-gnu": "0.76.0", "@oxfmt/binding-linux-x64-gnu": "0.76.0", "@oxfmt/binding-linux-x64-musl": "0.76.0", "@oxfmt/binding-openharmony-arm64": "0.76.0", "@oxfmt/binding-win32-arm64-msvc": "0.76.0", "@oxfmt/binding-win32-ia32-msvc": "0.76.0", "@oxfmt/binding-win32-x64-msvc": "0.76.0" }, "peerDependencies": { "@astrojs/compiler-rs": "^0.5.0", "svelte": "^5.0.0", "vite-plus": "*" }, "optionalPeers": ["@astrojs/compiler-rs", "svelte", "vite-plus"], "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-Yo9RIn9lRWTm/U8obHbXUWc39lCpEFXlEggFoPx01zS18OCFi7mAwMmL05+p1AunuJgSkONffWyBHJzpMMCRuQ=="], - "oxlint": ["oxlint@1.89.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.89.0", "@oxlint/binding-android-arm64": "1.89.0", "@oxlint/binding-darwin-arm64": "1.89.0", "@oxlint/binding-darwin-x64": "1.89.0", "@oxlint/binding-freebsd-x64": "1.89.0", "@oxlint/binding-linux-arm-gnueabihf": "1.89.0", "@oxlint/binding-linux-arm-musleabihf": "1.89.0", "@oxlint/binding-linux-arm64-gnu": "1.89.0", "@oxlint/binding-linux-arm64-musl": "1.89.0", "@oxlint/binding-linux-ppc64-gnu": "1.89.0", "@oxlint/binding-linux-riscv64-gnu": "1.89.0", "@oxlint/binding-linux-riscv64-musl": "1.89.0", "@oxlint/binding-linux-s390x-gnu": "1.89.0", "@oxlint/binding-linux-x64-gnu": "1.89.0", "@oxlint/binding-linux-x64-musl": "1.89.0", "@oxlint/binding-openharmony-arm64": "1.89.0", "@oxlint/binding-win32-arm64-msvc": "1.89.0", "@oxlint/binding-win32-ia32-msvc": "1.89.0", "@oxlint/binding-win32-x64-msvc": "1.89.0" }, "peerDependencies": { "oxlint-tsgolint": ">=7.0.2003", "vite-plus": "*" }, "optionalPeers": ["oxlint-tsgolint", "vite-plus"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-a25hkfo61okGPvJz432fRIPoxlKtNnOVy9w4rzrmGgNm4iVTPwpSQlmdqNWnp6p9QyyPVfAZRgnf5XvSBZFk/A=="], + "oxlint": ["oxlint@1.91.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.91.0", "@oxlint/binding-android-arm64": "1.91.0", "@oxlint/binding-darwin-arm64": "1.91.0", "@oxlint/binding-darwin-x64": "1.91.0", "@oxlint/binding-freebsd-x64": "1.91.0", "@oxlint/binding-linux-arm-gnueabihf": "1.91.0", "@oxlint/binding-linux-arm-musleabihf": "1.91.0", "@oxlint/binding-linux-arm64-gnu": "1.91.0", "@oxlint/binding-linux-arm64-musl": "1.91.0", "@oxlint/binding-linux-ppc64-gnu": "1.91.0", "@oxlint/binding-linux-riscv64-gnu": "1.91.0", "@oxlint/binding-linux-riscv64-musl": "1.91.0", "@oxlint/binding-linux-s390x-gnu": "1.91.0", "@oxlint/binding-linux-x64-gnu": "1.91.0", "@oxlint/binding-linux-x64-musl": "1.91.0", "@oxlint/binding-openharmony-arm64": "1.91.0", "@oxlint/binding-win32-arm64-msvc": "1.91.0", "@oxlint/binding-win32-ia32-msvc": "1.91.0", "@oxlint/binding-win32-x64-msvc": "1.91.0" }, "peerDependencies": { "oxlint-tsgolint": ">=7.0.2005", "vite-plus": "*" }, "optionalPeers": ["oxlint-tsgolint", "vite-plus"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-vjy/cBZcEFcYh3dbxUoQK+bjc+QaY3ZWo86aJkZ5YAwp/HyiqP7dTdNgbvcIVJafhAH5sZbTqBp4sZcicEZngA=="], "p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], @@ -663,7 +663,7 @@ "supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], - "thread-stream": ["thread-stream@4.2.0", "", { "dependencies": { "real-require": "^1.0.0" } }, "sha512-e2zZ96wSChazBsbENf/Pcm/4swHt2cEKQ92rhUjkL9GCKiTDJIaTBenjE/m9DXi0QBmTMDkFDdOomUy20A1tDQ=="], + "thread-stream": ["thread-stream@4.2.1", "", { "dependencies": { "real-require": "^1.0.0" } }, "sha512-Stg6edJXC/6/xqGwSXwFokrUhChJ18amEjpKH89WrQQ0oVFDF+pUUcTpiwWhFUrE89Vf16FBOlwhaw+lescxMQ=="], "through": ["through@2.3.8", "", {}, "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="], @@ -823,10 +823,10 @@ "wrap-ansi/string-width/emoji-regex": ["emoji-regex@10.6.0", "", {}, "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="], - "wrap-ansi/strip-ansi/ansi-regex": ["ansi-regex@6.4.0", "", {}, "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw=="], + "wrap-ansi/strip-ansi/ansi-regex": ["ansi-regex@6.5.0", "", {}, "sha512-zhvbbbdt1kbw7EJ9OQoxmQcuaNR9P5kTj7e/YdmOSU10aHWbycofJxA6jKfoEy3vlLdctOF9ZHaxLtmSm998wQ=="], - "boxen/string-width/strip-ansi/ansi-regex": ["ansi-regex@6.4.0", "", {}, "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw=="], + "boxen/string-width/strip-ansi/ansi-regex": ["ansi-regex@6.5.0", "", {}, "sha512-zhvbbbdt1kbw7EJ9OQoxmQcuaNR9P5kTj7e/YdmOSU10aHWbycofJxA6jKfoEy3vlLdctOF9ZHaxLtmSm998wQ=="], - "widest-line/string-width/strip-ansi/ansi-regex": ["ansi-regex@6.4.0", "", {}, "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw=="], + "widest-line/string-width/strip-ansi/ansi-regex": ["ansi-regex@6.5.0", "", {}, "sha512-zhvbbbdt1kbw7EJ9OQoxmQcuaNR9P5kTj7e/YdmOSU10aHWbycofJxA6jKfoEy3vlLdctOF9ZHaxLtmSm998wQ=="], } } diff --git a/browser/manifests/chromium.json b/browser/manifests/chromium.json index 7afe75e..2bf1e84 100644 --- a/browser/manifests/chromium.json +++ b/browser/manifests/chromium.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Parousia", - "version": "1.1.0", + "version": "1.2.0", "description": "Your Rich Presence on Discord and beyond.", "background": { "service_worker": "chromium.js", diff --git a/browser/manifests/firefox.json b/browser/manifests/firefox.json index 2b4e2a8..89bd8ff 100644 --- a/browser/manifests/firefox.json +++ b/browser/manifests/firefox.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Parousia", - "version": "1.1.0.1", + "version": "1.2.0", "description": "Your Rich Presence on Discord and beyond.", "background": { "scripts": ["firefox.js"], diff --git a/browser/package.json b/browser/package.json index a6b83f0..999abc8 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@abadima/rpc-browser", - "version": "1.1.0", + "version": "1.2.0", "private": true, "license": "Apache-2.0", "type": "module", @@ -37,9 +37,9 @@ "devDependencies": { "@fortawesome/free-solid-svg-icons": "^7.3.1", "@types/bun": "^1.4.4", - "@types/chrome": "^0.3.6", - "oxfmt": "^0.74.0", - "oxlint": "^1.89.0", + "@types/chrome": "^0.3.7", + "oxfmt": "^0.76.0", + "oxlint": "^1.91.0", "playwright-core": "^1.64.1", "web-ext": "^10.8.0" }, diff --git a/browser/scripts/activities/activities.test.ts b/browser/scripts/activities/activities.test.ts index 1325e28..358fb00 100644 --- a/browser/scripts/activities/activities.test.ts +++ b/browser/scripts/activities/activities.test.ts @@ -6,6 +6,7 @@ import { hostIds, manifestShard, parseCatalog, parseShard } from "../../src/acti import type { ActivityInfo } from "../../src/core/activity"; import { buildActivities, type ActivitiesBuild } from "./build"; import { activityId, folderLetter, websiteFolders } from "./discover"; +import { versionFrom } from "./metadata"; import { discover, linkVariants, websiteKey } from "./pipeline"; import { descriptionFiles, @@ -84,6 +85,7 @@ describe("one pipeline for both sources", () => { id: "tunes", name: "Tunes", description: "What's playing on tunes.example, for tests.", + version: "1.2.3", hosts: ["tunes.example"], source: "parousia", icon: "https://tunes.example/icon.png", @@ -96,6 +98,7 @@ describe("one pipeline for both sources", () => { id: "premid:Example", name: "Example", description: "Example, for tests.", + version: "2.0.5", hosts: ["example.com", "www.example.com"], source: "premid", icon: "https://cdn.example/example.png", @@ -153,6 +156,7 @@ describe("native Activities (parousia-project/activities)", () => { await place("U/Unknown", { ...valid, id: "unknown", permissions: ["tabs"] }); await place("C/Creators", { ...valid, id: "creators", data: ["creatorIcons"] }); await place("I/Icon", { ...valid, id: "icon", icon: "http://site.example/icon.png" }); + await place("V/Version", { ...valid, id: "version", version: "1.0" }); const { native, problems } = await discover("parousia", root); expect(native.map((found) => found.manifest.info.id)).toEqual(["site"]); expect(problems).toEqual([ @@ -160,6 +164,7 @@ describe("native Activities (parousia-project/activities)", () => { 'websites/E/Everywhere: matches: "*://*/*" isn\'t a match pattern for particular sites', "websites/I/Icon: icon must be an https image URL of at most 256 characters", 'websites/U/Unknown: unknown key "permissions"', + "websites/V/Version: version must be MAJOR.MINOR.PATCH", 'websites/W/Wrong Id: id must be "wrong-id", the folder\'s name in lowercase words joined by "-"', "websites/X/Misfiled: it goes in websites/M/", ]); @@ -169,6 +174,17 @@ describe("native Activities (parousia-project/activities)", () => { }); }); +describe("an Activity's version", () => { + test("is MAJOR.MINOR.PATCH from its metadata.json, and anything else is no version", () => { + expect(versionFrom("1.2.3")).toBe("1.2.3"); + expect(versionFrom("10.0.12")).toBe("10.0.12"); + for (const other of ["1.2", "v1.2.3", "1.2.3-beta", "1.2.3.4", " 1.2.3", "", 1.2, null]) { + expect(versionFrom(other)).toBeUndefined(); + } + expect(versionFrom(undefined)).toBeUndefined(); + }); +}); + describe("websites in both sources", () => { test("are linked by folder name, never by a site they happen to share", () => { const info = (id: string, source: "parousia" | "premid", hosts: string[]) => { @@ -404,6 +420,12 @@ describe("the packaged build", () => { expect(full?.keywords).toBeUndefined(); expect(example?.description).toBeDefined(); expect((await shard("tunes"))?.info.data).toEqual(["media", "thumbnails"]); + // Only an Activity's own page shows its version, so the manifest has it and the catalog doesn't. + expect(catalog.activities.some((info) => info.version !== undefined)).toBe(false); + expect(full?.version).toBe("2.0.5"); + expect((await shard("tunes"))?.info.version).toBe("1.2.3"); + // A service with a folder per API version shows the one that runs (v1), not the newest. + expect((await shard("premid:Versioned"))?.info.version).toBe("1.0.0"); // Manifests share a file by first letter, so there's no file per Activity and no index of them. expect(Object.keys((await read("activities/manifests/t.json")) as object).sort()).toEqual([ "premid:Tunes", diff --git a/browser/scripts/activities/fixtures/parousia/websites/T/Tunes/activity.ts b/browser/scripts/activities/fixtures/parousia/websites/T/Tunes/activity.ts index f77d568..9f23e58 100644 --- a/browser/scripts/activities/fixtures/parousia/websites/T/Tunes/activity.ts +++ b/browser/scripts/activities/fixtures/parousia/websites/T/Tunes/activity.ts @@ -10,6 +10,7 @@ export default { return { id: "tunes", name: "Tunes", + type: "listening" as const, url: `${page.url.origin}${page.url.pathname}`, details: page.media?.title ?? page.title, ...(page.thumbnail && { assets: { largeImage: page.thumbnail } }), diff --git a/browser/scripts/activities/fixtures/parousia/websites/T/Tunes/metadata.json b/browser/scripts/activities/fixtures/parousia/websites/T/Tunes/metadata.json index c6bbb8e..03f5561 100644 --- a/browser/scripts/activities/fixtures/parousia/websites/T/Tunes/metadata.json +++ b/browser/scripts/activities/fixtures/parousia/websites/T/Tunes/metadata.json @@ -4,7 +4,7 @@ "id": "tunes", "name": "Tunes", "description": "What's playing on tunes.example, for tests.", - "version": "1.0.0", + "version": "1.2.3", "authors": [{ "name": "Test" }], "icon": "https://tunes.example/icon.png", "matches": ["https://tunes.example/listen*"], diff --git a/browser/scripts/activities/fixtures/premid/websites/E/Example/metadata.json b/browser/scripts/activities/fixtures/premid/websites/E/Example/metadata.json index 02fb5f6..0671552 100644 --- a/browser/scripts/activities/fixtures/premid/websites/E/Example/metadata.json +++ b/browser/scripts/activities/fixtures/premid/websites/E/Example/metadata.json @@ -15,7 +15,7 @@ }, "url": ["example.com", "www.example.com"], "regExp": "^https?[:][/][/](www[.])?example[.]com[/]", - "version": "1.0.0", + "version": "2.0.5", "logo": "https://cdn.example/example.png", "thumbnail": "https://cdn.example/example-thumb.png", "color": "#000000", diff --git a/browser/scripts/activities/fixtures/premid/websites/V/Versioned/v2/metadata.json b/browser/scripts/activities/fixtures/premid/websites/V/Versioned/v2/metadata.json index 4727c8f..8ffb8cb 100644 --- a/browser/scripts/activities/fixtures/premid/websites/V/Versioned/v2/metadata.json +++ b/browser/scripts/activities/fixtures/premid/websites/V/Versioned/v2/metadata.json @@ -11,7 +11,7 @@ }, "url": "versioned.example", "regExp": "^https?[:][/][/]versioned[.]example[/]", - "version": "1.0.0", + "version": "9.9.9", "logo": "https://cdn.example/versioned.png", "thumbnail": "https://cdn.example/versioned-thumb.png", "color": "#000000", diff --git a/browser/scripts/activities/metadata.ts b/browser/scripts/activities/metadata.ts index aebed70..8e116c6 100644 --- a/browser/scripts/activities/metadata.ts +++ b/browser/scripts/activities/metadata.ts @@ -20,6 +20,7 @@ export interface Draft { id: string; name: string; description?: string; + version?: string; hosts: string[]; match: ActivityMatch; icon?: string; @@ -49,6 +50,13 @@ export const LIMITS = { export const SETTING_ID = /^[A-Za-z0-9_-]{1,64}$/; export const CLIENT_ID = /^\d{17,20}$/; +/** An Activity's version, as both sources' metadata.json write it. */ +export const VERSION = /^\d+\.\d+\.\d+$/; + +/** A metadata.json `version` if it's one, so a PreMiD Activity with an odd one still builds, only without it. */ +export const versionFrom = (value: unknown): string | undefined => + typeof value === "string" && VERSION.test(value) ? value : undefined; + /** What's wrong with a setting, by the rules both sources' settings follow, or `null`. */ export function checkSetting(setting: ActivitySetting): string | null { if (!SETTING_ID.test(setting.id)) return "its id isn't 1 to 64 letters, digits, _ or -"; @@ -124,6 +132,7 @@ export function manifestFrom(draft: Draft): ActivityManifest { }; const description = draft.description?.trim().slice(0, LIMITS.description); if (description) info.description = description; + if (draft.version) info.version = draft.version; if (draft.keywords && draft.keywords.length > 0) info.keywords = keywordsFrom(draft.keywords); if (draft.icon) info.icon = draft.icon; if (draft.discordClientId) info.discordClientId = draft.discordClientId; diff --git a/browser/scripts/activities/native.ts b/browser/scripts/activities/native.ts index a13d2ae..ef00e5a 100644 --- a/browser/scripts/activities/native.ts +++ b/browser/scripts/activities/native.ts @@ -4,7 +4,14 @@ import type { ActivitySetting, PageDataKind, SettingValue } from "../../src/core import { compileMatchPattern, patternHost } from "../../src/core/match-pattern"; import type { ActivityManifest } from "../../src/activities/manifest"; import { FOLDER_NAME, activityId, folderLetter, type WebsiteFolder } from "./discover"; -import { CLIENT_ID, LIMITS, checkSetting, manifestFrom, patternOrigin } from "./metadata"; +import { + CLIENT_ID, + LIMITS, + checkSetting, + manifestFrom, + patternOrigin, + versionFrom, +} from "./metadata"; /** * The adapter for native Activities (github.com/parousia-project/activities): @@ -131,9 +138,8 @@ export function parseNativeMetadata( if (!isText(description, LIMITS.description)) { problems.push(`description must be 1 to ${LIMITS.description} characters`); } - if (typeof version !== "string" || !/^\d+\.\d+\.\d+$/.test(version)) { - problems.push("version must be MAJOR.MINOR.PATCH"); - } + const release = versionFrom(version); + if (release === undefined) problems.push("version must be MAJOR.MINOR.PATCH"); if ( !Array.isArray(authors) || authors.length === 0 || @@ -213,6 +219,7 @@ export function parseNativeMetadata( id, name, description, + version: release, hosts: patterns.map(patternHost), match: { patterns }, ...(typeof icon === "string" && { icon }), diff --git a/browser/scripts/activities/premid.ts b/browser/scripts/activities/premid.ts index 16b0aa6..7ad7a20 100644 --- a/browser/scripts/activities/premid.ts +++ b/browser/scripts/activities/premid.ts @@ -17,6 +17,7 @@ import { hostOrigin, keywordsFrom, manifestFrom, + versionFrom, } from "./metadata"; /** @@ -331,6 +332,7 @@ async function readActivity( id: premidId(service), name: service, ...(isObject(description) && isString(description.en) && { description: description.en }), + version: versionFrom(metadata.version), hosts, match: { regExp: pattern }, icon: logo, diff --git a/browser/scripts/e2e/lib.mjs b/browser/scripts/e2e/lib.mjs index 56f0639..bd374bd 100644 --- a/browser/scripts/e2e/lib.mjs +++ b/browser/scripts/e2e/lib.mjs @@ -56,6 +56,17 @@ export function assert(condition, message) { export const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); +/** + * Where a Chromium-based browser comes from: `PAROUSIA_CHROMIUM_BINARY` (for + * example Helium's `/usr/bin/helium`, or any Chromium build), or else the one + * playwright-core installed. Set explicitly, never a silent fallback: a run + * says which browser it used. + */ +export function chromiumLaunch() { + const binary = process.env.PAROUSIA_CHROMIUM_BINARY; + return binary ? { executablePath: binary } : { channel: "chromium" }; +} + /** Polls `check` (which returns a truthy value when done) until it passes. Test-side only. */ export async function waitUntil(check, description, timeoutMs = STEP_TIMEOUT_MS) { const deadline = Date.now() + timeoutMs; diff --git a/browser/scripts/i18n.test.ts b/browser/scripts/i18n.test.ts index a444340..4d28713 100644 --- a/browser/scripts/i18n.test.ts +++ b/browser/scripts/i18n.test.ts @@ -25,7 +25,7 @@ describe("finding the strings", () => { test("the code and the pages hold the strings the dictionaries are checked against", () => { expect(keys.strings.size).toBeGreaterThan(200); - expect(keys.strings.has("Retry Connection")).toBe(true); + expect(keys.strings.has("Retry connection")).toBe(true); expect(keys.strings.has("Settings")).toBe(true); expect(keys.plurals.has("{n} Activities")).toBe(true); // Written with `tn`, so they're plural forms, not plain strings. diff --git a/browser/scripts/verify-activities-firefox.mjs b/browser/scripts/verify-activities-firefox.mjs index afaf265..faeef6b 100644 --- a/browser/scripts/verify-activities-firefox.mjs +++ b/browser/scripts/verify-activities-firefox.mjs @@ -223,7 +223,7 @@ try { ); assert( card.action === "Allow access" && card.current, - "offers to ask again, with no empty Current activity", + "offers to ask again, with no empty Now sharing", ); await firefox.closeTab(popup); log( diff --git a/browser/scripts/verify-activities.mjs b/browser/scripts/verify-activities.mjs index 216c2b8..e91d0a4 100644 --- a/browser/scripts/verify-activities.mjs +++ b/browser/scripts/verify-activities.mjs @@ -19,10 +19,18 @@ // - Native: an Activity that reads pages is off until turned on, which the // popup does in one click; the collector reads the page's Media Session. // - Settings > Privacy: what Activities may read, for all of them at once. -// - The popup: "Current activity" only while something's shared, "Configure +// - The popup: "Now sharing" only while something's shared, "Configure // activity" for an Activity with settings, and a quiet line otherwise. // - The Default Activity: written in the dashboard, shared where no Activity // is, and gone once it's off. +// - Show media presence, with a tab that really makes sound: the song stays on +// Discord on a site without an Activity, a song skipped in a tab nobody is +// looking at reaches Discord (headless Chromium never hides a tab, so the tab +// switch is played back into the extension's own world: see `setHidden`), +// of two players only the one shared last shows, the song comes back when +// the extension's background is stopped and starts again, +// and the popup beside music (or the Default Activity) still offers the +// site's own Activity. // - The dashboard: switches, icons and their fallback, site access in // Settings only ("all websites" off), and the layout from phone to // ultrawide. @@ -49,6 +57,7 @@ import { STEP_TIMEOUT_MS, assert, browserDir, + chromiumLaunch, control, logger, sleep, @@ -91,10 +100,12 @@ const flatpak = process.env.ACTIVITIES_BROWSER === "flatpak"; async function launchBrowser(profileDir, extensionDir) { const args = [`--disable-extensions-except=${extensionDir}`, `--load-extension=${extensionDir}`]; if (!flatpak) { + // Not muted, and free to play without a click: a tab with a tone in it is really audible. const context = await chromium.launchPersistentContext(profileDir, { - channel: "chromium", + ...chromiumLaunch(), headless: true, - args, + ignoreDefaultArgs: ["--mute-audio"], + args: [...args, "--autoplay-policy=no-user-gesture-required"], }); return { context, name: "playwright-core's Chromium", close: () => context.close() }; } @@ -228,7 +239,7 @@ try { launched = await launchBrowser(join(ws.dir, "profile"), extensionDir); context = launched.context; log(`in ${launched.name}`); - const worker = + let worker = context.serviceWorkers()[0] ?? (await context.waitForEvent("serviceworker", { timeout: STEP_TIMEOUT_MS })); const id = new URL(worker.url()).host; @@ -313,7 +324,7 @@ try { `listed once, as the native one (${guideCards})`, ); assert( - (await dashboard.textContent(`[data-activity="${GUIDE_NATIVE}"]`))?.includes("multi"), + (await dashboard.textContent(`[data-activity="${GUIDE_NATIVE}"]`))?.includes("2 sources"), "and marked as in both sources", ); await openDashboard(`#activities/${GUIDE_NATIVE}`); @@ -437,7 +448,7 @@ try { assert(!injected, "its script never ran there"); let popup = await popupFor(jummbox); await popup.locator("#suggestion-view:not([hidden])").waitFor(); - assert(await popup.isHidden("#activity-view"), "the popup hides Current activity"); + assert(await popup.isHidden("#activity-view"), "the popup hides Now sharing"); assert((await popup.textContent("#suggestion-name")) === "Jummbox", "and names the Activity"); assert( (await popup.textContent("#suggestion-note"))?.includes("access to jummb.us"), @@ -523,14 +534,14 @@ try { "native: Tunes is off until the popup turns it on in one click; then the collector reads the page's Media Session, and the site's logo instead of the artwork once thumbnails are off", ); - // --- The popup while sharing: Configure activity --- + // --- The popup while sharing: Configure Activity --- const example = await context.newPage(); await serve(example, "https://example.site", "Docs"); await example.goto(EXAMPLE_PAGE); await shown((a) => a?.details === "Reading Docs", "Example Site, with its default prefix"); popup = await popupFor(example); await popup.locator("#activity-view:not([hidden])").waitFor(); - assert(await popup.isHidden("#suggestion-view"), "the popup shows Current activity alone"); + assert(await popup.isHidden("#suggestion-view"), "the popup shows Now sharing alone"); await popup.click("#configure-button"); const prefix = popup.locator("#configure-view input.text-field"); await prefix.waitFor(); @@ -540,7 +551,7 @@ try { await example.bringToFront(); await shown((a) => a?.details === "Browsing Docs", "the new prefix, set from the popup"); log( - "the popup shows Current activity only while sharing, and changes the Activity's settings in place", + "the popup shows Now sharing only while sharing, and changes the Activity's settings in place", ); // --- The Default Activity --- @@ -551,12 +562,12 @@ try { popup = await popupFor(nothing); await popup.locator("#idle-view:not([hidden])").waitFor(); assert( - (await popup.textContent("#idle-view")) === "Nothing to share on this page.", + (await popup.textContent("#idle-view")) === "Nothing to share here.", "the popup says so in one line", ); assert( (await popup.isHidden("#activity-view")) && (await popup.isHidden("#suggestion-view")), - "without an empty Current activity", + "without an empty Now sharing", ); await popup.done(); @@ -606,12 +617,192 @@ try { "the Default Activity: its own tab, a name required and links checked, shared where no Activity is, and gone once off", ); + // --- The popup beside the Default Activity, and beside music kept from another tab --- + const setPreferences = (patch) => + worker.evaluate(async (next) => { + const { preferences = {} } = await chrome.storage.local.get("preferences"); + await chrome.storage.local.set({ preferences: { ...preferences, ...next } }); + }, patch); + const setDefault = (activity) => + worker.evaluate((next) => chrome.storage.local.set({ defaultActivity: next }), activity); + const detailsSent = () => discord.activities.map((a) => a?.details ?? null); + /** A music page that really plays a tone, with `skipTo` to change song as a player does and `stopTone` to end the sound. */ + const player = async (title) => { + const page = await context.newPage(); + await serve( + page, + "https://tunes.example", + `Tunes`, + ); + await page.goto(TUNES_PAGE); + return page; + }; + const audibleTabs = () => + worker.evaluate(async () => (await chrome.tabs.query({ audible: true })).length); + /** + * Headless Chromium never hides a tab (every page stays "visible", even with + * another in front), so the one thing a real browser does on a tab switch is + * played back into the extension's own world in `page`: `document.hidden` + * and a `visibilitychange`. That world is where the collector and PreMiD + * scripts run; the page's own world, its sound, and everything else are real. + */ + async function setHidden(page, hidden) { + const session = await context.newCDPSession(page); + const worlds = []; + session.on("Runtime.executionContextCreated", ({ context: world }) => worlds.push(world)); + await session.send("Runtime.enable"); + const ours = worlds.filter((world) => world.origin === extension); + assert(ours.length > 0, "the extension has a script running in the page"); + for (const world of ours) { + await session.send("Runtime.evaluate", { + contextId: world.id, + expression: `Object.defineProperty(document, "hidden", { get: () => ${hidden}, configurable: true }); + document.dispatchEvent(new Event("visibilitychange"));`, + }); + } + await session.detach(); + } + + // Jummbox is on, and its site isn't granted: an Activity the site has, which can't run. + await setDefault({ enabled: true, name: "Studying", elapsed: false }); + const jummboxAgain = await context.newPage(); + await serve(jummboxAgain, "https://jummb.us", "JummBox

Beep

"); + await jummboxAgain.goto("https://jummb.us/"); + await shown( + (a) => a?.name === "Studying", + "the Default Activity, on a site whose Activity can't run", + ); + popup = await popupFor(jummboxAgain); + await popup.locator("#activity-view:not([hidden])").waitFor(); + await popup.locator("#suggestion-view:not([hidden])").waitFor(); + assert( + (await popup.textContent("#content"))?.includes("Studying"), + "the popup shows what's being shared", + ); + assert( + (await popup.textContent("#suggestion-name")) === "Jummbox" && + (await popup.textContent("#suggestion-action"))?.trim() === "Allow access", + "and, beside it, the site's own Activity, which it offers to allow", + ); + await popup.done(); + await setDefault({ enabled: false, name: "Studying" }); + await shown((a) => a === null, "nothing, once the Default Activity is off"); + + await setPreferences({ showMediaPresence: true }); + const songTab = await player("Song 1"); + await songTab.bringToFront(); + await shown((a) => a?.details === "Song 1", "the first song"); + await waitUntil(async () => (await audibleTabs()) === 1, "sound in the first tab"); + await nothing.bringToFront(); + await setHidden(songTab, true); + await sleep(1500); + const kept = detailsSent(); + assert(kept.at(-1) === "Song 1", `the song stays on a site without an Activity (${kept})`); + assert( + !kept.slice(kept.lastIndexOf("Song 1")).includes(null), + "and Discord was never cleared on the way", + ); + + // The tab nobody is looking at reads on: a skipped song is news. + await songTab.evaluate(() => window.skipTo("Song 2")); + await shown( + (a) => a?.details === "Song 2", + "the next song, skipped in a tab nobody is looking at", + ); + await songTab.evaluate(() => window.skipTo("Song 3")); + await shown((a) => a?.details === "Song 3", "and the one after"); + + // Of two players, the one shared last: the other moving on doesn't take over. + const otherTab = await player("Other 1"); + await otherTab.bringToFront(); + await shown((a) => a?.details === "Other 1", "the second player, shared last"); + await waitUntil(async () => (await audibleTabs()) === 2, "sound in both tabs"); + await nothing.bringToFront(); + await setHidden(otherTab, true); + await sleep(1500); + await songTab.evaluate(() => window.skipTo("Song 4")); + await sleep(3000); + const both = detailsSent(); + assert(!both.includes("Song 4"), `the other player moving on takes nothing over (${both})`); + assert(both.at(-1) === "Other 1", "the one shared last stays"); + await otherTab.evaluate(() => window.stopTone()); + await shown( + (a) => a?.details === "Song 4", + "the first player's current song, once the other stops", + ); + + // The background restarts (MV3 stops and starts it), with the music still kept in a tab nobody is looking at. + { + // The dashboard holds a UI port that keeps the worker alive; let it go. + await dashboard.goto("about:blank"); + const session = await context.newCDPSession(nothing); + await session.send("ServiceWorker.enable"); + // An in-memory mark, gone when the worker really stops. MV3 may restart it + // before Desktop sees the disconnect, so wait for a fresh global instead. + const mark = `before-restart-${Date.now()}`; + await worker.evaluate((value) => { + globalThis.__parousiaRestart = value; + }, mark); + await session.send("ServiceWorker.stopAllWorkers"); + // A tab event wakes it, if it hasn't started again already. + await jummboxAgain.bringToFront(); + await nothing.bringToFront(); + worker = await waitUntil(async () => { + for (const candidate of context.serviceWorkers()) { + const seen = await candidate + .evaluate(() => globalThis.__parousiaRestart) + .catch(() => false); + if (seen !== false && seen !== mark) return candidate; + } + return false; + }, "a fresh background after the restart"); + await session.detach(); + await shown((a) => a?.details === "Song 4", "the song again, once the background is back"); + } + + // The popup beside kept music: what's shown, and the site's own Activity, not one hiding the other. + popup = await popupFor(jummboxAgain); + await popup.locator("#activity-view:not([hidden])").waitFor(); + await popup.locator("#suggestion-view:not([hidden])").waitFor(); + assert( + (await popup.textContent("#content"))?.includes("Song 4"), + "the popup shows the music being kept", + ); + assert( + (await popup.textContent("#suggestion-name")) === "Jummbox" && + (await popup.textContent("#suggestion-action"))?.trim() === "Allow access", + "and the site's own Activity, with the setting still on", + ); + await popup.done(); + + await setPreferences({ showMediaPresence: false }); + await shown((a) => a === null, "nothing, once the setting is off"); + await songTab.close(); + await otherTab.close(); + await jummboxAgain.close(); + log( + "media presence in a real browser: the song stays on a site without an Activity, a skipped song in a hidden tab reaches Discord, of two players the one shared last shows, the song comes back when the background restarts, and the popup beside it (and beside the Default Activity) still offers the site's own Activity", + ); + // --- Site access lives in Settings: only "all websites", off by default --- await openDashboard("#settings/access"); await dashboard.waitForSelector("#setting-allSites"); assert( !(await dashboard.isChecked("#setting-allSites")), - '"Access your data for all websites" is off by default', + '"Allow access to all websites" is off by default', ); assert( (await dashboard.locator("#granted-sites, [data-site]").count()) === 0, @@ -738,7 +929,7 @@ try { await bulk("Enable all").click(); const question = (await dashboard.textContent('[data-slot="bulk-body"]')) ?? ""; assert( - question.includes("None of them needs access to a new site"), + question.includes("None needs access to a new site"), `enabling ones whose sites are granted says it will not ask (${question})`, ); await dashboard.locator('[data-slot="bulk-body"] button', { hasText: /^Enable \d/ }).click(); diff --git a/browser/scripts/verify-desktop-link.mjs b/browser/scripts/verify-desktop-link.mjs index be2c1a2..2c3a0ad 100644 --- a/browser/scripts/verify-desktop-link.mjs +++ b/browser/scripts/verify-desktop-link.mjs @@ -28,6 +28,7 @@ import { QUIET_DISCORD, assert, browserDir, + chromiumLaunch, command, control, logger, @@ -45,6 +46,13 @@ import { const log = logger("desktop-link"); /** What Desktop calls this OS in a browser's name ("Chromium on Linux"). */ const os = windows ? "Windows" : "Linux"; +/** + * The browser's name as Desktop shows it, from the user agent (client-name.ts): + * "Chromium" for Playwright's build, "Chrome" for one that doesn't identify + * itself in its brands (Helium, headless). The check accepts either, since it + * is about Desktop accepting this browser's connection, not about its brand. + */ +const browserName = "(?:Chrome|Chromium)"; const extensionDir = resolve(browserDir, process.env.PAROUSIA_BUILD_DIR ?? "dist", "chromium"); const escape = (text) => text.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&"); @@ -52,7 +60,7 @@ async function launch(userDataDir, dir = extensionDir) { // channel "chromium" runs the full build in new headless mode, which // (unlike the headless shell) can load extensions. const context = await chromium.launchPersistentContext(userDataDir, { - channel: "chromium", + ...chromiumLaunch(), headless: true, args: [`--disable-extensions-except=${dir}`, `--load-extension=${dir}`], }); @@ -139,8 +147,11 @@ try { assert(saved.allowedOrigins.includes(a.origin), "and persists it to config.json"); popupA = await reopen(a, popupA); await popup.waitForStatus(popupA, /^Connected to Parousia Desktop$/); - await desktop.waitFor(new RegExp(`Chromium on ${os} connected from ${escape(a.origin)}`), since); - await desktop.waitFor(new RegExp(`presence from Chromium on ${os}: none`), since); + await desktop.waitFor( + new RegExp(`${browserName} on ${os} connected from ${escape(a.origin)}`), + since, + ); + await desktop.waitFor(new RegExp(`presence from ${browserName} on ${os}: none`), since); log("allowed from the CLI: connects, Presence arrives; saved to config.json"); // --- A second browser, at the same time --- diff --git a/browser/scripts/verify-malsync-real.mjs b/browser/scripts/verify-malsync-real.mjs index 32a515a..d07db69 100644 --- a/browser/scripts/verify-malsync-real.mjs +++ b/browser/scripts/verify-malsync-real.mjs @@ -382,7 +382,7 @@ try { "while Discord-RPC-Extension's route still names the series, which Parousia can't limit", ); t.say( - "Share Media Details off limits Parousia's route; Discord-RPC-Extension's still shows the title", + "Share media details off limits Parousia's route; Discord-RPC-Extension's still shows the title", ); // MAL-Sync's own Discord setting off ends the duplicate; Parousia still gets it. diff --git a/browser/scripts/version.test.ts b/browser/scripts/version.test.ts index fee8965..f8bee27 100644 --- a/browser/scripts/version.test.ts +++ b/browser/scripts/version.test.ts @@ -52,11 +52,11 @@ describe("the extension's version", () => { expect(firefox === release || firefox.startsWith(`${release}.`)).toBe(true); }); - test("is the 1.1.0 release", async () => { + test("is the 1.2.0 release", async () => { // Bump this with the manifests and package.json when the next release is cut. // Desktop versions on its own (desktop/Cargo.toml); the tag is the extension's. - expect((await read("chromium.json")).version).toBe("1.1.0"); - expect((await read("firefox.json")).version).toBe("1.1.0.1"); + expect((await read("chromium.json")).version).toBe("1.2.0"); + expect((await read("firefox.json")).version).toBe("1.2.0"); }); test("is the userscript's version too", async () => { diff --git a/browser/src/activities/collector.test.ts b/browser/src/activities/collector.test.ts index d1621be..958232a 100644 --- a/browser/src/activities/collector.test.ts +++ b/browser/src/activities/collector.test.ts @@ -1,5 +1,5 @@ -import { describe, expect, test } from "bun:test"; -import { collect, loadedImages, unchanged } from "./collector"; +import { afterEach, describe, expect, test } from "bun:test"; +import { collect, loadedImages, startCollector, unchanged } from "./collector"; /** Enough of a document: its media elements, and an og:image. */ function page( @@ -193,3 +193,101 @@ describe("the page-data collector", () => { ).toBeUndefined(); }); }); + +describe("the collector in a tab that is not shown", () => { + const scope = globalThis as Record; + const globals = ["window", "document", "chrome", "location"] as const; + const before = new Map( + [...globals, "navigator"].map((key) => [key, Object.getOwnPropertyDescriptor(scope, key)]), + ); + afterEach(() => { + for (const [key, descriptor] of before) { + if (descriptor) Object.defineProperty(scope, key, descriptor); + else delete scope[key]; + } + }); + + /** A page playing a song, started for one Activity, with the messages it sends and gets through its port. */ + function playing() { + const posted: Array<{ type: string; data?: { media?: { title?: string } } }> = []; + const receivers: Array<(message: unknown) => void> = []; + const documentListeners = new Map void>(); + const metadata = { title: "Song A" }; + const document = { + hidden: false, + querySelectorAll: () => [], + querySelector: () => null, + addEventListener: (type: string, listener: () => void) => + documentListeners.set(type, listener), + removeEventListener: () => {}, + }; + const define = (key: string, value: unknown): void => { + Object.defineProperty(scope, key, { value, configurable: true, writable: true }); + }; + define("window", { addEventListener: () => {}, removeEventListener: () => {} }); + define("location", { pathname: "/play", search: "" }); + define("document", document); + define("navigator", { mediaSession: { metadata, playbackState: "playing" } }); + define("chrome", { + runtime: { + connect: () => ({ + postMessage: (message: (typeof posted)[number]) => posted.push(message), + onMessage: { addListener: (l: (message: unknown) => void) => receivers.push(l) }, + onDisconnect: { addListener: () => {} }, + disconnect: () => {}, + }), + }, + }); + startCollector("tunes"); + const receive = (message: object): void => receivers.forEach((l) => l(message)); + return { + receive, + titles: () => + posted.filter((m) => m.type === "data").map((m) => m.data?.media?.title ?? null), + setTitle: (title: string) => { + metadata.title = title; + }, + setHidden: (hidden: boolean) => { + document.hidden = hidden; + documentListeners.get("visibilitychange")?.(); + }, + }; + } + + const tick = (): Promise => new Promise((resolve) => setTimeout(resolve, 1200)); + + test("reads a new song only while the background keeps its music or video", async () => { + const { receive, titles, setTitle, setHidden } = playing(); + receive({ type: "collect", kinds: ["media"] }); + expect(titles()).toEqual(["Song A"]); + + setTitle("Song B"); + await tick(); + expect(titles()).toEqual(["Song A", "Song B"]); + + // Left in the background, it reads nothing: a skipped song wasn't news. + setHidden(true); + setTitle("Song C"); + await tick(); + expect(titles()).toEqual(["Song A", "Song B"]); + + // Kept: it reads now, and again every second, while hidden. + receive({ type: "background", on: true }); + expect(titles()).toEqual(["Song A", "Song B", "Song C"]); + setTitle("Song D"); + await tick(); + expect(titles()).toEqual(["Song A", "Song B", "Song C", "Song D"]); + + // No longer kept: quiet again. + receive({ type: "background", on: false }); + setTitle("Song E"); + await tick(); + expect(titles()).toEqual(["Song A", "Song B", "Song C", "Song D"]); + + // Shown again, it catches up. + setHidden(false); + await tick(); + expect(titles().at(-1)).toBe("Song E"); + receive({ type: "stop" }); + }, 15_000); +}); diff --git a/browser/src/activities/collector.ts b/browser/src/activities/collector.ts index 7ccf27e..9840a04 100644 --- a/browser/src/activities/collector.ts +++ b/browser/src/activities/collector.ts @@ -28,8 +28,9 @@ import { PlayerBridge, type PlayerClock } from "./player-bridge"; * * It's shared by every native Activity that declares these, and runs only * for one that does: injected (as `activities/collector.js`) into the active - * tab's page, it reads once a second while the page is visible and sends - * only changes. A song playing through is no change: its `start` and `end` + * tab's page, it reads once a second while the page is shown, or while the + * background says its music or video is kept (`background`), and sends only + * changes. A song playing through is no change: its `start` and `end` * stay put until it's paused or seeked. */ export const COLLECTOR_KEY = "__parousiaCollector"; @@ -170,8 +171,11 @@ export function startCollector(activity: string): void { let kinds: PageDataKind[] = []; let sent: PageData | null = null; let closed = false; + /** The background keeps this tab's music or video, so it reads even while the tab isn't shown. */ + let background = false; let port: chrome.runtime.Port | null = null; let timer: ReturnType | null = null; + const reading = (): boolean => !document.hidden || background; const bridge = new PlayerBridge( () => document.querySelectorAll("iframe"), () => location.pathname + location.search, @@ -208,6 +212,10 @@ export function startCollector(activity: string): void { kinds = message.kinds; sent = null; tick(); + } else if (message?.type === "background") { + background = message.on; + schedule(); + tick(); } }); opened.onDisconnect.addListener(() => { @@ -233,7 +241,7 @@ export function startCollector(activity: string): void { }; function tick(): void { - if (closed || document.hidden) return; + if (closed || !reading()) return; if (kinds.length === 0) { // Not told what to read yet (or the background restarted): ask. open(); @@ -248,8 +256,8 @@ export function startCollector(activity: string): void { function schedule(): void { if (closed) return; - if (!document.hidden && timer === null) timer = setInterval(tick, TICK_MS); - else if (document.hidden && timer !== null) { + if (reading() && timer === null) timer = setInterval(tick, TICK_MS); + else if (!reading() && timer !== null) { clearInterval(timer); timer = null; } diff --git a/browser/src/activities/host.test.ts b/browser/src/activities/host.test.ts index dce036b..bcac201 100644 --- a/browser/src/activities/host.test.ts +++ b/browser/src/activities/host.test.ts @@ -231,7 +231,10 @@ describe("PageHost: PreMiD Activities", () => { const port = page(); port.send({ type: "hello", activity: PREMID, clientId: DEFAULT_CLIENT }); await settle(); - expect(port.posted).toEqual([{ type: "settings", values: { lang: "en", buttons: true } }]); + expect(port.posted).toEqual([ + { type: "settings", values: { lang: "en", buttons: true } }, + { type: "background", on: false }, + ]); port.send({ type: "activity", @@ -401,7 +404,10 @@ describe("PageHost: native Activities that take page data", () => { const port = collector(open); port.send({ type: "hello", activity: "tunes" }); await settle(); - expect(port.posted).toEqual([{ type: "collect", kinds: ["media"] }]); + expect(port.posted).toEqual([ + { type: "collect", kinds: ["media"] }, + { type: "background", on: false }, + ]); port.send({ type: "data", data: { media: { title: "Song", playing: true, start: 1_700_000_000_000 } }, @@ -445,3 +451,214 @@ describe("PageHost: native Activities that take page data", () => { expect(port.posted).toEqual([{ type: "stop" }]); }); }); + +describe("PageHost: what runs for an Activity that's off", () => { + test("it doesn't answer before the first stored states are in, so defaults never decide for an Activity someone turned off", async () => { + const { host, injected, started } = setup(); + let answered = false; + const pending = host.page(9, TUNES).then((result) => { + answered = true; + return result; + }); + await settle(20); + expect(answered).toBe(false); + + await host.setStates({ tunes: { on: false } }); + expect(await pending).toEqual({}); + expect(injected).toEqual([]); + expect(started).toEqual([]); + }); + + test("once the states are in, an Activity that's on is looked at as before", async () => { + const { host, started } = setup(); + const pending = host.page(9, TUNES); + await host.setStates({ tunes: { on: true } }); + expect(await pending).toEqual({ granted: ["media", "thumbnails"] }); + await settle(); + expect(started).toEqual([[9, "tunes"]]); + }); + + test("peek reads what a tab last reported and injects nothing", async () => { + const { host, injected, started, open } = setup(); + await host.setStates({ tunes: { on: true } }); + expect(await host.page(9, TUNES)).toEqual({ granted: ["media", "thumbnails"] }); + await settle(); + const port = open(PAGE_DATA_PORT, { id: "self", url: TUNES.href, frameId: 0, tab: { id: 9 } }); + port.send({ type: "hello", activity: "tunes" }); + port.send({ type: "data", data: { media: { title: "Song", playing: true } } }); + await settle(250); + + injected.length = 0; + started.length = 0; + expect(await host.peek(9, TUNES)).toEqual({ + granted: ["media", "thumbnails"], + data: { media: { title: "Song", playing: true } }, + }); + // A tab nobody has looked at: what it may read, and no script put into it. + expect(await host.peek(12, TUNES)).toEqual({ granted: ["media", "thumbnails"] }); + expect(injected).toEqual([]); + expect(started).toEqual([]); + }); + + test("peek finds nothing for an Activity that's off or whose site was taken back", async () => { + const off = setup(); + await off.host.setStates({ tunes: { on: false } }); + expect(await off.host.peek(9, TUNES)).toEqual({}); + + const denied = setup(NO_GRANTS); + await denied.host.setStates({ tunes: { on: true } }); + expect(await denied.host.peek(9, TUNES)).toEqual({}); + expect(denied.injected).toEqual([]); + }); + + test("turning an Activity off stops its collector in every tab, and what it read is gone", async () => { + const { host, open, changed } = setup(); + await host.setStates({ tunes: { on: true } }); + const ports = [9, 10].map((tab) => { + const port = open(PAGE_DATA_PORT, { + id: "self", + url: TUNES.href, + frameId: 0, + tab: { id: tab }, + }); + port.send({ type: "hello", activity: "tunes" }); + port.send({ type: "data", data: { media: { title: `Song ${tab}`, playing: true } } }); + return port; + }); + await settle(250); + changed.length = 0; + + await host.setStates({ tunes: { on: false } }); + for (const port of ports) { + expect(port.posted.at(-1)).toEqual({ type: "stop" }); + expect(port.disconnected).toBe(true); + } + expect(changed.toSorted((a, b) => a - b)).toEqual([9, 10]); + expect(await host.peek(9, TUNES)).toEqual({}); + expect(await host.peek(10, TUNES)).toEqual({}); + }); +}); + +describe("PageHost: tabs whose music or video is kept", () => { + const background = (port: { posted: unknown[] }) => + port.posted.filter((message) => (message as { type?: string }).type === "background"); + + test("their scripts are told to keep reading while the tab is in the background, and only theirs", async () => { + const { host, open, page } = setup(); + await host.setStates({ ...on, tunes: { on: true } }); + const premidPort = page(); + premidPort.send({ type: "hello", activity: PREMID, clientId: DEFAULT_CLIENT }); + const kept = open(PAGE_DATA_PORT, { id: "self", url: TUNES.href, frameId: 0, tab: { id: 9 } }); + kept.send({ type: "hello", activity: "tunes" }); + const other = open(PAGE_DATA_PORT, { + id: "self", + url: TUNES.href, + frameId: 0, + tab: { id: 10 }, + }); + other.send({ type: "hello", activity: "tunes" }); + await settle(); + + host.keepReading([9, 7]); + // Told where each stands when it connected, and the tabs kept told again. + const told = [ + { type: "background", on: false }, + { type: "background", on: true }, + ]; + expect(background(kept)).toEqual(told); + expect(background(premidPort)).toEqual(told); + expect(background(other)).toEqual([{ type: "background", on: false }]); + + // Told once: the same tabs again change nothing. + host.keepReading([7, 9]); + expect(background(kept)).toHaveLength(2); + expect(background(premidPort)).toHaveLength(2); + }); + + test("a tab no longer kept is told to read only while shown again", async () => { + const { host, open } = setup(); + await host.setStates({ tunes: { on: true } }); + const kept = open(PAGE_DATA_PORT, { id: "self", url: TUNES.href, frameId: 0, tab: { id: 9 } }); + kept.send({ type: "hello", activity: "tunes" }); + await settle(); + host.keepReading([9]); + host.keepReading([]); + expect(background(kept)).toEqual([ + { type: "background", on: false }, + { type: "background", on: true }, + { type: "background", on: false }, + ]); + }); + + test("a script that connects later in a kept tab is told at once, and an iframe's too", async () => { + const { host, open } = setup({ all: true, origins: [] }); + await host.setStates(on); + host.keepReading([7]); + const late = open(PREMID_PORT, { + id: "self", + url: WATCH.href, + frameId: 0, + tab: { id: 7 }, + }); + late.send({ type: "hello", activity: PREMID, clientId: DEFAULT_CLIENT }); + const frame = open(PREMID_FRAME_PORT, { + id: "self", + url: "https://player.example/embed", + frameId: 3, + tab: { id: 7 }, + }); + frame.send({ type: "hello", activity: PREMID }); + await settle(); + expect(background(late)).toEqual([{ type: "background", on: true }]); + expect(background(frame)).toEqual([{ type: "background", on: true }]); + }); + + test("a script that connects is always told where it stands, so none stays stuck reading in the background", async () => { + const { host, open } = setup(); + await host.setStates({ tunes: { on: true } }); + const plain = open(PAGE_DATA_PORT, { id: "self", url: TUNES.href, frameId: 0, tab: { id: 9 } }); + plain.send({ type: "hello", activity: "tunes" }); + await settle(); + // Not kept: told so, in case it was told otherwise before the background restarted. + expect(background(plain)).toEqual([{ type: "background", on: false }]); + }); + + test("a closed tab is forgotten, so a page opened under its number reads only while shown", async () => { + const { host, open } = setup(); + await host.setStates({ tunes: { on: true } }); + host.keepReading([9]); + host.forget(9); + const reused = open(PAGE_DATA_PORT, { + id: "self", + url: TUNES.href, + frameId: 0, + tab: { id: 9 }, + }); + reused.send({ type: "hello", activity: "tunes" }); + await settle(); + expect(background(reused)).toEqual([{ type: "background", on: false }]); + }); +}); + +describe("PageHost: stopping a tab's scripts", () => { + test("stops the scripts running in that tab, drops what they reported, and leaves other tabs alone", async () => { + const { host, page } = setup(); + await host.setStates(on); + const stopped = page(); + stopped.send({ type: "hello", activity: PREMID, clientId: DEFAULT_CLIENT }); + const kept = page(WATCH.href, { tab: { id: 8 } }); + kept.send({ type: "hello", activity: PREMID, clientId: DEFAULT_CLIENT }); + stopped.send({ type: "activity", clientId: DEFAULT_CLIENT, data: { details: "Watching" } }); + await settle(250); + expect((await host.peek(7, WATCH)).reported).toBeDefined(); + + host.stopTabs([7]); + expect(stopped.posted.at(-1)).toEqual({ type: "stop" }); + expect(stopped.disconnected).toBe(true); + expect(kept.posted.some((message) => (message as { type?: string }).type === "stop")).toBe( + false, + ); + expect(kept.disconnected).toBe(false); + expect((await host.peek(7, WATCH)).reported).toBeUndefined(); + }); +}); diff --git a/browser/src/activities/host.ts b/browser/src/activities/host.ts index 61722f2..b8564cb 100644 --- a/browser/src/activities/host.ts +++ b/browser/src/activities/host.ts @@ -184,6 +184,8 @@ export class PageHost { private readonly again = new Set(); /** The URL each tab's scripts were last injected for. */ private readonly visited = new Map(); + /** Tabs whose music or video is kept: their scripts read even while the tab isn't shown. */ + private readonly background = new Set(); /** Settles once the first states are in, so a page connecting right after a restart isn't turned away. */ private readonly ready = Promise.withResolvers(); @@ -304,13 +306,33 @@ export class PageHost { * Injects what the Activity needs there, if it isn't already. An Activity * that reads pages is found here only where its site is granted. */ - async page(tabId: number, url: URL): Promise> { + page(tabId: number, url: URL): Promise> { + return this.read(tabId, url, true); + } + + /** + * The same for a tab that isn't the one being shared, for music or video + * kept from it: what its scripts last reported, and nothing injected. + */ + peek(tabId: number, url: URL): Promise> { + return this.read(tabId, url, false); + } + + private async read( + tabId: number, + url: URL, + inject: boolean, + ): Promise> { await this.grants(); + // Not before the stored states are in: until then every Activity is at its + // default, and one someone turned off would run once. The runtime resolves + // only after this, so nothing of an Activity runs ahead of its switch. + await this.ready.promise; const resolved = this.registry.resolve(url, (info) => this.usable(info, url)); const manifest = resolved && this.running.get(resolved.info.id); if (!manifest) return {}; const granted = allowedData(manifest.info, this.pageData); - this.visit(tabId, url, manifest, granted); + if (inject) this.visit(tabId, url, manifest, granted); const report = this.reports.get(tabId); if (report?.manifest !== manifest) return { granted }; if (report.kind === "collector") return { granted, data: report.data }; @@ -353,8 +375,33 @@ export class PageHost { this.visited.delete(tabId); } + /** + * The tabs whose music or video is kept (see core/media-presence.ts). A + * script in a tab that isn't shown reads nothing, so a skipped song would + * never reach Discord: these are told to keep reading, and the rest to read + * only while their tab is shown, as ever. + */ + keepReading(tabs: Iterable): void { + const next = new Set(tabs); + for (const tabId of this.background) { + if (next.has(tabId)) continue; + this.background.delete(tabId); + this.tellBackground(tabId, false); + } + for (const tabId of next) { + if (this.background.has(tabId)) continue; + this.background.add(tabId); + this.tellBackground(tabId, true); + } + } + + private tellBackground(tabId: number, on: boolean): void { + for (const live of this.live.get(tabId) ?? []) this.post(live.port, { type: "background", on }); + } + /** The tab closed. */ forget(tabId: number): void { + this.background.delete(tabId); this.visited.delete(tabId); this.reports.delete(tabId); this.live.delete(tabId); @@ -363,6 +410,21 @@ export class PageHost { this.again.delete(tabId); } + /** + * Stops every script running in these tabs, and drops what they reported: + * a private tab under "Pause activity" runs nothing, even scripts that were + * already running there before the setting changed. + */ + stopTabs(tabs: Iterable): void { + for (const tabId of tabs) { + this.background.delete(tabId); + this.visited.delete(tabId); + for (const live of this.live.get(tabId) ?? []) this.refuse(live.port); + this.live.delete(tabId); + if (this.reports.delete(tabId)) this.changed(tabId); + } + } + /** Access was granted or taken back: what runs on sites no longer granted stops now. */ private async accessChanged(): Promise { this.grantsNow = null; @@ -493,6 +555,9 @@ export class PageHost { lives.add(live); this.live.set(tabId, lives); this.tell(live); + // Where it stands, whichever way: a script keeps what it was last told when the background + // restarts, and the background doesn't remember who it told. + this.post(port, { type: "background", on: this.background.has(tabId) }); }; const handle = async (raw: unknown): Promise => { diff --git a/browser/src/activities/manifest.test.ts b/browser/src/activities/manifest.test.ts index ca08b92..4e99379 100644 --- a/browser/src/activities/manifest.test.ts +++ b/browser/src/activities/manifest.test.ts @@ -207,6 +207,7 @@ describe("one manifest for both sources", () => { test("the catalog lists an Activity without what only its own page needs", () => { const entry = catalogEntry({ ...native.info, + version: "1.2.3", settings: [{ id: "a", title: "A", type: "boolean", default: true }], data: ["media"], origins: ["https://tunes.example/*"], diff --git a/browser/src/activities/manifest.ts b/browser/src/activities/manifest.ts index a9622cd..b77088e 100644 --- a/browser/src/activities/manifest.ts +++ b/browser/src/activities/manifest.ts @@ -143,7 +143,13 @@ export const shardPath = (id: string): string => shardFile(manifestShard(id)); /** An Activity as the catalog lists it: everything but what only its own page needs. */ export function catalogEntry(info: ActivityInfo): ActivityInfo { - const { settings: _settings, data: _data, discordClientId: _discordClientId, ...entry } = info; + const { + settings: _settings, + data: _data, + discordClientId: _discordClientId, + version: _version, + ...entry + } = info; return entry; } diff --git a/browser/src/activities/messages.test.ts b/browser/src/activities/messages.test.ts index a28d594..67de46d 100644 --- a/browser/src/activities/messages.test.ts +++ b/browser/src/activities/messages.test.ts @@ -102,6 +102,18 @@ describe("PreMiD page messages", () => { expect(parseToPage({ type: "page-result", nonce: -1, value: 1 })).toBeNull(); }); + test("a page is told to keep reading in the background with a real boolean, and nothing else", () => { + expect(parseToPage({ type: "background", on: true })).toEqual({ type: "background", on: true }); + expect(parseToPage({ type: "background", on: false })).toEqual({ + type: "background", + on: false, + }); + for (const on of ["true", 1, null, undefined]) { + expect(parseToPage({ type: "background", on })).toBeNull(); + } + expect(parseToPage({ type: "background" })).toBeNull(); + }); + test("page images are bounded: https only, a short list, short text", () => { const parsed = parsePageData({ images: [ @@ -153,5 +165,10 @@ describe("PreMiD page messages", () => { type: "collect", kinds: ["media"], }); + expect(parseToCollector({ type: "background", on: true })).toEqual({ + type: "background", + on: true, + }); + expect(parseToCollector({ type: "background", on: "yes" })).toBeNull(); }); }); diff --git a/browser/src/activities/messages.ts b/browser/src/activities/messages.ts index e34ef34..e32fa09 100644 --- a/browser/src/activities/messages.ts +++ b/browser/src/activities/messages.ts @@ -49,6 +49,11 @@ export type ToPage = | { type: "settings"; values: Record } | { type: "page-result"; nonce: number; value: unknown } | { type: "frame-data"; data: unknown } + /** + * Keep reading while the tab is in the background (`on`), or only while it's + * shown: the tab's music or video is being kept, so a skipped song is news. + */ + | { type: "background"; on: boolean } /** Not wanted here (turned off, or not this page's): stop ticking and don't reconnect. */ | { type: "stop" }; @@ -182,6 +187,9 @@ export function parseToPage(value: unknown): ToPage | null { if (value.type === "frame-data" && "data" in value) { return { type: "frame-data", data: value.data }; } + if (value.type === "background" && typeof value.on === "boolean") { + return { type: "background", on: value.on }; + } if (value.type === "stop") return { type: "stop" }; return null; } @@ -194,7 +202,10 @@ export type CollectorMessage = export type ToCollector = /** What to read: the kinds its Activity declares, isn't denied, and has access for. */ - { type: "collect"; kinds: PageDataKind[] } | { type: "stop" }; + | { type: "collect"; kinds: PageDataKind[] } + /** As for a page script (`ToPage`): keep reading while the tab is in the background. */ + | { type: "background"; on: boolean } + | { type: "stop" }; const MAX_TEXT = 256; const MAX_URL = 512; @@ -266,6 +277,9 @@ export function parseCollectorMessage(value: unknown): CollectorMessage | null { export function parseToCollector(value: unknown): ToCollector | null { if (!isObject(value)) return null; if (value.type === "stop") return { type: "stop" }; + if (value.type === "background" && typeof value.on === "boolean") { + return { type: "background", on: value.on }; + } if (value.type === "collect" && Array.isArray(value.kinds)) { const kinds: readonly unknown[] = value.kinds; return { type: "collect", kinds: PAGE_DATA_KINDS.filter((kind) => kinds.includes(kind)) }; diff --git a/browser/src/core/activity.ts b/browser/src/core/activity.ts index ed7be55..34a04a4 100644 --- a/browser/src/core/activity.ts +++ b/browser/src/core/activity.ts @@ -66,6 +66,8 @@ export interface ActivityInfo { /** The sites it recognizes, for display and search, e.g. `youtube.com`. */ hosts: string[]; source: ActivitySource; + /** Its own version, as its metadata.json gives it (`MAJOR.MINOR.PATCH`). Only its page shows it. */ + version?: string; /** More words to find it by: other names, tags. */ keywords?: string[]; /** Its icon: an `https` image URL, shown in the dashboard when it loads. */ diff --git a/browser/src/core/default-activity.ts b/browser/src/core/default-activity.ts index c9645f5..e6248a5 100644 --- a/browser/src/core/default-activity.ts +++ b/browser/src/core/default-activity.ts @@ -116,19 +116,18 @@ export function defaultActivityProblems( activity: DefaultActivity, ): Partial> { const problems: Partial> = {}; - if (activity.name.trim().length < 2) - problems.name = t("Give it a name of at least 2 characters."); + if (activity.name.trim().length < 2) problems.name = t("Use a name of at least 2 characters."); for (const field of TEXT_FIELDS) { const value = activity[field].trim(); if (field !== "name" && value.length === 1) { - problems[field] = t("Discord leaves out lines under 2 characters."); + problems[field] = t("Discord drops lines shorter than 2 characters."); } } for (const field of IMAGE_FIELDS) { const value = activity[field].trim(); if (value && !isImage(value)) { problems[field] = t( - "Use an https image link, or an asset name from your own Discord Application.", + "Use an https image link, or an asset name from your Discord application.", ); } } @@ -138,10 +137,10 @@ export function defaultActivityProblems( if (!label && !url) continue; if (!label || !url) problems.buttons = t("A button needs both a label and a link."); else if (!isWebUrl(url, ["https:", "http:"])) - problems.buttons = t("Button links start with https:// or http://."); + problems.buttons = t("Button links must start with https:// or http://."); } if (activity.discordClientId && !/^\d{17,20}$/.test(activity.discordClientId)) { - problems.discordClientId = t("A Discord Application ID is 17 to 20 digits."); + problems.discordClientId = t("A Discord application ID is 17 to 20 digits."); } return problems; } diff --git a/browser/src/core/media-presence.test.ts b/browser/src/core/media-presence.test.ts new file mode 100644 index 0000000..61e7f66 --- /dev/null +++ b/browser/src/core/media-presence.test.ts @@ -0,0 +1,261 @@ +import { describe, expect, test } from "bun:test"; +import type { Activity } from "./activity"; +import { MediaTabs, isMediaActivity } from "./media-presence"; + +const song: Activity = { id: "player", name: "Player", type: "listening" }; +const film: Activity = { id: "movies", name: "Movies", type: "watching" }; +const timed: Activity = { id: "radio", name: "Radio", timestamps: { start: 1, end: 2 } }; +const browsing: Activity = { id: "shop", name: "Shop", details: "Browsing" }; +const elapsed: Activity = { id: "game", name: "Game", timestamps: { start: 1 } }; + +/** Resolves a tab to what it shows, for the tabs in `shows`; a tab not in it is gone. */ +const resolver = + (shows: Map) => + async (tabId: number): Promise => { + if (!shows.has(tabId)) throw new Error("no such tab"); + return shows.get(tabId) ?? null; + }; + +describe("isMediaActivity", () => { + test("music and video are what an Activity presents as listening or watching, or with a length", () => { + expect(isMediaActivity(song)).toBe(true); + expect(isMediaActivity(film)).toBe(true); + expect(isMediaActivity(timed)).toBe(true); + }); + + test("ordinary browsing is not, nor is elapsed time alone", () => { + expect(isMediaActivity(browsing)).toBe(false); + expect(isMediaActivity(elapsed)).toBe(false); + expect(isMediaActivity({ id: "chess", name: "Chess", type: "playing" })).toBe(false); + expect(isMediaActivity({ id: "contest", name: "Contest", type: "competing" })).toBe(false); + }); +}); + +describe("MediaTabs: which tabs are remembered", () => { + test("a tab shared with music playing is remembered", () => { + const tabs = new MediaTabs(); + tabs.shared(1, song, true); + expect(tabs.has(1)).toBe(true); + }); + + test("a media tab that is silent was never playing, so it is not remembered", () => { + const tabs = new MediaTabs(); + tabs.shared(1, song, false); + expect(tabs.has(1)).toBe(false); + }); + + test("sound without a media Activity is not remembered: browsing with a video ad is not a video", () => { + const tabs = new MediaTabs(); + tabs.shared(1, browsing, true); + tabs.shared(2, elapsed, true); + tabs.shared(3, null, true); + expect([1, 2, 3].some((id) => tabs.has(id))).toBe(false); + }); + + test("pausing keeps a remembered tab, so playing again in the background still counts", () => { + const tabs = new MediaTabs(); + tabs.shared(1, song, true); + tabs.shared(1, song, false); + expect(tabs.has(1)).toBe(true); + }); + + test("a tab that is shared again without media (it went to another site) is forgotten", () => { + const tabs = new MediaTabs(); + tabs.shared(1, song, true); + tabs.shared(1, null, true); + expect(tabs.has(1)).toBe(false); + tabs.shared(1, song, true); + tabs.shared(1, browsing, true); + expect(tabs.has(1)).toBe(false); + }); + + test("a closed tab, and clearing, forget", () => { + const tabs = new MediaTabs(); + tabs.shared(1, song, true); + tabs.shared(2, film, true); + tabs.forget(1); + expect(tabs.has(1)).toBe(false); + tabs.clear(); + expect(tabs.has(2)).toBe(false); + }); +}); + +describe("MediaTabs: choosing one", () => { + test("nothing remembered, nothing chosen", async () => { + expect(await new MediaTabs().pick(1, resolver(new Map()))).toBeNull(); + }); + + test("never the tab being shared: its own Activity is what it shows", async () => { + const tabs = new MediaTabs(); + tabs.shared(1, song, true); + const shows = new Map([[1, song]]); + expect(await tabs.pick(1, resolver(shows))).toBeNull(); + }); + + test("with several players, only the one shared most recently is chosen", async () => { + const tabs = new MediaTabs(); + tabs.shared(1, song, true); + tabs.shared(2, film, true); + tabs.shared(3, timed, true); + const shows = new Map([ + [1, song], + [2, film], + [3, timed], + ]); + expect(await tabs.pick(9, resolver(shows))).toEqual({ tab: 3, media: timed }); + }); + + test("a player that stops gives way to the one before it, and back again when it resumes", async () => { + const tabs = new MediaTabs(); + tabs.shared(1, song, true); + tabs.shared(2, film, true); + const shows = new Map([ + [1, song], + [2, film], + ]); + expect((await tabs.pick(9, resolver(shows)))?.tab).toBe(2); + shows.set(2, null); + expect((await tabs.pick(9, resolver(shows)))?.tab).toBe(1); + shows.set(1, null); + expect(await tabs.pick(9, resolver(shows))).toBeNull(); + shows.set(2, film); + expect((await tabs.pick(9, resolver(shows)))?.tab).toBe(2); + }); + + test("a background tab changing track does not take over: recency is when a tab was last shared", async () => { + const tabs = new MediaTabs(); + tabs.shared(1, song, true); + tabs.shared(2, film, true); + const next: Activity = { ...song, details: "Next track" }; + const shows = new Map([ + [1, next], + [2, film], + ]); + // Tab 1 plays on and changes in the background; tab 2 was shared later and stays the one. + expect((await tabs.pick(9, resolver(shows)))?.tab).toBe(2); + expect((await tabs.pick(9, resolver(shows)))?.tab).toBe(2); + }); + + test("visiting a player again makes it the most recent", async () => { + const tabs = new MediaTabs(); + tabs.shared(1, song, true); + tabs.shared(2, film, true); + tabs.shared(1, song, true); + const shows = new Map([ + [1, song], + [2, film], + ]); + expect((await tabs.pick(9, resolver(shows)))?.tab).toBe(1); + }); + + test("a tab that is gone is forgotten and skipped", async () => { + const tabs = new MediaTabs(); + tabs.shared(1, song, true); + tabs.shared(2, film, true); + const shows = new Map([[1, song]]); + expect((await tabs.pick(9, resolver(shows)))?.tab).toBe(1); + expect(tabs.has(2)).toBe(false); + }); +}); + +describe("MediaTabs: telling which tabs are remembered", () => { + function watched() { + const heard: number[][] = []; + return { tabs: new MediaTabs((tabs) => heard.push([...tabs])), heard }; + } + + test("is told when a tab is remembered, and when it is forgotten", () => { + const { tabs, heard } = watched(); + tabs.shared(1, song, true); + tabs.shared(2, film, true); + tabs.forget(1); + tabs.clear(); + expect(heard).toEqual([[1], [1, 2], [2], []]); + }); + + test("is told when visiting an older player changes which is the most recent, not when the newest is shared again", () => { + const { tabs, heard } = watched(); + tabs.shared(1, song, true); + tabs.shared(2, film, true); + tabs.shared(2, film, true); + tabs.shared(1, song, true); + expect(heard).toEqual([[1], [1, 2], [2, 1]]); + }); + + test("is not told when a remembered tab is shared again, or paused: the same tabs are remembered", () => { + const { tabs, heard } = watched(); + tabs.shared(1, song, true); + tabs.shared(1, song, true); + tabs.shared(1, song, false); + expect(heard).toEqual([[1]]); + }); + + test("is told when a tab drops out for not showing media any more, or for being gone", async () => { + const { tabs, heard } = watched(); + tabs.shared(1, song, true); + tabs.shared(2, film, true); + tabs.shared(1, null, true); + await tabs.pick(9, resolver(new Map([[3, null]]))); + expect(heard).toEqual([[1], [1, 2], [2], []]); + }); + + test("is not told about tabs that were never remembered", () => { + const { tabs, heard } = watched(); + tabs.shared(1, song, false); + tabs.shared(2, browsing, true); + tabs.forget(3); + tabs.clear(); + expect(heard).toEqual([]); + }); +}); + +describe("MediaTabs: remembering across a restart", () => { + test("restores tabs in the order they were remembered, oldest first, the most recent winning", async () => { + const tabs = new MediaTabs(); + tabs.restore([4, 7, 2]); + const shows = new Map([ + [4, song], + [7, film], + [2, timed], + ]); + expect((await tabs.pick(9, resolver(shows)))?.tab).toBe(2); + shows.set(2, null); + expect((await tabs.pick(9, resolver(shows)))?.tab).toBe(7); + shows.set(7, null); + expect((await tabs.pick(9, resolver(shows)))?.tab).toBe(4); + }); + + test("a tab shared since the restart is more recent than any restored one", async () => { + const tabs = new MediaTabs(); + tabs.shared(5, film, true); + tabs.restore([1, 2]); + const shows = new Map([ + [1, song], + [2, timed], + [5, film], + ]); + expect((await tabs.pick(9, resolver(shows)))?.tab).toBe(5); + }); + + test("is told what it now remembers, and keeps tabs it already had", () => { + const heard: number[][] = []; + const tabs = new MediaTabs((list) => heard.push([...list])); + tabs.shared(5, film, true); + tabs.restore([1, 5, 2]); + expect(heard.at(-1)).toEqual([1, 2, 5]); + expect(tabs.order()).toEqual([1, 2, 5]); + }); + + test("restoring nothing tells nobody", () => { + const heard: number[][] = []; + new MediaTabs((list) => heard.push([...list])).restore([]); + expect(heard).toEqual([]); + }); + + test("a restored tab that is gone is forgotten when it is looked at", async () => { + const tabs = new MediaTabs(); + tabs.restore([1, 2]); + expect((await tabs.pick(9, resolver(new Map([[1, song]]))))?.tab).toBe(1); + expect(tabs.has(2)).toBe(false); + }); +}); diff --git a/browser/src/core/media-presence.ts b/browser/src/core/media-presence.ts new file mode 100644 index 0000000..923fd55 --- /dev/null +++ b/browser/src/core/media-presence.ts @@ -0,0 +1,109 @@ +import type { Activity } from "./activity"; + +/** + * Whether `activity` presents music or video: as "Listening to" or "Watching", + * or with an end time, which a track or a video of some length has. Whether it + * plays now is the tab's sound, which the browser reports and a page can't + * claim. Ordinary browsing is neither, nor is elapsed time alone. + */ +export function isMediaActivity(activity: Activity): boolean { + return ( + activity.type === "listening" || + activity.type === "watching" || + activity.timestamps?.end !== undefined + ); +} + +/** + * The tabs that showed music or video while they were the one shared, for + * "Show media presence": one of them keeps its presence going while another + * tab is shared that has nothing of its own. Only tabs that were shared get + * here, so a page never gets its music or video shown without having been + * looked at first. + * + * Which one wins is when each was last shared, not which changed last: a + * player that moves on to its next track in the background doesn't take + * over, so two playing at once never trade places. + */ +export class MediaTabs { + /** Tabs by the order in which they were last shared with music or video playing. */ + private readonly sharedAt = new Map(); + private clock = 0; + + /** `onChange` hears every change to which tabs are remembered, and to which is the most recent. */ + constructor(private readonly onChange: (tabs: readonly number[]) => void = () => {}) {} + + /** The tabs remembered, the one shared longest ago first. */ + order(): number[] { + return [...this.sharedAt].sort(([, a], [, b]) => a - b).map(([tab]) => tab); + } + + private changed(): void { + this.onChange(this.order()); + } + + /** + * The tab being shared, with `own`, what its Activity detects there (none + * for a site without one), and whether sound is playing in it. Playing + * music or video makes it the most recent; paused, a tab already + * remembered stays, to count again when it resumes; anything else forgets it. + */ + shared(tabId: number, own: Activity | null, audible: boolean): void { + if (own === null || !isMediaActivity(own)) { + this.forget(tabId); + } else if (audible) { + const known = this.sharedAt.has(tabId); + const newest = this.order().at(-1); + this.sharedAt.set(tabId, ++this.clock); + if (!known || newest !== tabId) this.changed(); + } + } + + /** + * Puts back tabs remembered before the background restarted (`order`, the + * oldest first), as older than any shared since. A tab that has closed + * meanwhile is forgotten when it is next looked at. + */ + restore(order: readonly number[]): void { + const fresh = [...new Set(order)].filter((tab) => !this.sharedAt.has(tab)); + fresh.forEach((tab, index) => this.sharedAt.set(tab, index - fresh.length)); + if (fresh.length > 0) this.changed(); + } + + has(tabId: number): boolean { + return this.sharedAt.has(tabId); + } + + forget(tabId: number): void { + if (this.sharedAt.delete(tabId)) this.changed(); + } + + clear(): void { + if (this.sharedAt.size === 0) return; + this.sharedAt.clear(); + this.changed(); + } + + /** + * The most recently shared tab, other than `except` (the one being shared), + * for which `media` has something: its music or video as it is now. A tab + * `media` throws for is gone, and forgotten. + */ + async pick( + except: number, + media: (tabId: number) => Promise, + ): Promise<{ tab: number; media: T } | null> { + const newest = [...this.sharedAt] + .filter(([tab]) => tab !== except) + .sort(([, a], [, b]) => b - a); + for (const [tab] of newest) { + try { + const found = await media(tab); + if (found !== null) return { tab, media: found }; + } catch { + this.forget(tab); + } + } + return null; + } +} diff --git a/browser/src/core/preferences.test.ts b/browser/src/core/preferences.test.ts index 96e4bd4..2a202e8 100644 --- a/browser/src/core/preferences.test.ts +++ b/browser/src/core/preferences.test.ts @@ -41,6 +41,15 @@ describe("parsePreferences", () => { expect(parsePreferences(undefined)).toEqual(DEFAULT_PREFERENCES); }); + test("showing media presence is off by default, and only a real boolean turns it on", () => { + expect(DEFAULT_PREFERENCES.showMediaPresence).toBe(false); + expect(parsePreferences({ showMediaPresence: true }).showMediaPresence).toBe(true); + expect(parsePreferences({ showMediaPresence: false }).showMediaPresence).toBe(false); + for (const bad of ["true", 1, null, [], {}]) { + expect(parsePreferences({ showMediaPresence: bad }).showMediaPresence).toBe(false); + } + }); + test("invalid fields fall back one by one, valid ones are kept", () => { expect( parsePreferences({ diff --git a/browser/src/core/preferences.ts b/browser/src/core/preferences.ts index 52896ec..32d8ad4 100644 --- a/browser/src/core/preferences.ts +++ b/browser/src/core/preferences.ts @@ -15,6 +15,11 @@ export interface Preferences { language: LanguagePreference; /** Off: publish only the Activity's name, never its details, state, or image captions. */ shareMediaDetails: boolean; + /** + * Keep showing music or video that's playing in another tab while the tab + * shared has no Activity of its own (see media-presence.ts). Off by default. + */ + showMediaPresence: boolean; /** How long presence stays after the browser loses focus; 0 clears it at once. Sound playing in the tab keeps it either way. */ idleTimeoutMinutes: number; incognito: IncognitoBehavior; @@ -37,6 +42,7 @@ export const IDLE_TIMEOUT_STEPS: readonly number[] = [0, 1, 2, 5, 10, 15, 30, 60 export const DEFAULT_PREFERENCES: Preferences = { language: "auto", shareMediaDetails: true, + showMediaPresence: false, idleTimeoutMinutes: 1, incognito: "pause", platforms: { discord: true, fluxer: true, stoat: true }, @@ -60,6 +66,7 @@ export function parsePreferences(value: unknown): Preferences { return { language: LANGUAGES.find((language) => language === stored.language) ?? "auto", shareMediaDetails: flag(stored.shareMediaDetails, DEFAULT_PREFERENCES.shareMediaDetails), + showMediaPresence: flag(stored.showMediaPresence, DEFAULT_PREFERENCES.showMediaPresence), idleTimeoutMinutes: typeof stored.idleTimeoutMinutes === "number" && IDLE_TIMEOUT_STEPS.includes(stored.idleTimeoutMinutes) diff --git a/browser/src/core/runtime.test.ts b/browser/src/core/runtime.test.ts index 5fda90b..620e4a7 100644 --- a/browser/src/core/runtime.test.ts +++ b/browser/src/core/runtime.test.ts @@ -262,3 +262,83 @@ describe("PresenceRuntime", () => { expect(registry.list().map((info) => info.id)).toEqual(["a", "b"]); }); }); + +describe("PresenceRuntime: music or video kept from another tab", () => { + const registry = new ActivityRegistry(); + const detections: string[] = []; + registry.register({ + info: { id: "site", name: "Site", hosts: ["site.example"], source: "parousia" }, + matcher: (url) => url.hostname === "site.example", + detect: ({ url }) => { + detections.push(url.href); + return { id: "site", name: "Site", url: url.href }; + }, + }); + const kept: Activity = { id: "player", name: "Player", type: "listening" }; + const fallback: Activity = { id: "default", name: "Default" }; + const nowhere = { url: new URL("https://nowhere.example"), title: "" }; + const site = { url: new URL("https://site.example"), title: "" }; + + test("shown when the page has nothing of its own, ahead of the fallback", () => { + const runtime = new PresenceRuntime(registry, { media: () => kept, fallback: () => fallback }); + expect(runtime.resolve(nowhere).activity?.id).toBe("player"); + // A browser page, which no Activity covers, is the same. + expect(runtime.resolve(null).activity?.id).toBe("player"); + }); + + test("the page's own Activity comes first", () => { + const runtime = new PresenceRuntime(registry, { media: () => kept, fallback: () => fallback }); + expect(runtime.resolve(site).activity?.id).toBe("site"); + }); + + test("an Activity from another extension, which takes the page over, comes first too", () => { + const runtime = new PresenceRuntime(registry, { + external: () => ({ id: "compat:other", name: "Other" }), + media: () => kept, + }); + expect(runtime.resolve(nowhere).activity?.id).toBe("compat:other"); + }); + + test("with none to keep, the fallback is shown; with neither, nothing", () => { + expect( + new PresenceRuntime(registry, { media: () => null, fallback: () => fallback }).resolve( + nowhere, + ).activity?.id, + ).toBe("default"); + expect( + new PresenceRuntime(registry, { media: () => null }).resolve(nowhere).activity, + ).toBeNull(); + }); + + test("detect is the registry alone: no Activity from another extension, no media, no fallback", () => { + const runtime = new PresenceRuntime(registry, { + external: () => ({ id: "compat:other", name: "Other" }), + media: () => kept, + fallback: () => fallback, + }); + expect(runtime.detect(nowhere)).toBeNull(); + expect(runtime.detect(site)?.id).toBe("site"); + }); + + test("an Activity that isn't usable is never run, by resolve or by detect", () => { + detections.length = 0; + const runtime = new PresenceRuntime(registry, { usable: () => false, media: () => null }); + expect(runtime.detect(site)).toBeNull(); + expect(runtime.resolve(site).activity).toBeNull(); + expect(detections).toEqual([]); + }); + + test("an Activity that throws shows nothing, and the page falls through", () => { + const broken = new ActivityRegistry(); + broken.register({ + info: { id: "broken", name: "Broken", hosts: ["site.example"], source: "parousia" }, + matcher: () => true, + detect: () => { + throw new Error("page changed"); + }, + }); + const runtime = new PresenceRuntime(broken, { media: () => kept }); + expect(runtime.detect(site)).toBeNull(); + expect(runtime.resolve(site).activity?.id).toBe("player"); + }); +}); diff --git a/browser/src/core/runtime.ts b/browser/src/core/runtime.ts index ff98d83..32d8cef 100644 --- a/browser/src/core/runtime.ts +++ b/browser/src/core/runtime.ts @@ -9,6 +9,11 @@ export interface RuntimeOptions { usable?: (info: ActivityInfo, url: URL) => boolean; /** Its settings as set; by default, each at its default. */ settings?: (info: ActivityInfo) => SettingValues; + /** + * Music or video still playing in another tab (see media-presence.ts): + * shared when the page has nothing of its own, ahead of the fallback. + */ + media?: () => Activity | null; /** What to share when no Activity has anything to: the Default Activity, if one is set up. */ fallback?: () => Activity | null; /** @@ -41,24 +46,38 @@ export class PresenceRuntime { return this.registry.resolve(url, usable && ((info) => usable(info, url))); } - /** The Presence for `page`, or for no page at all (a browser page, a new tab): the fallback, if any. */ + /** + * What the Activity for `page` detects there, with its Discord Application + * and an image to fall back on: the registry alone, with no Activity from + * another extension, no media kept from another tab, and no fallback. Only + * an Activity that's `usable` here is ever run. + */ + detect(page: Page): Activity | null { + const registered = this.find(page.url); + if (!registered) return null; + const settings = this.options.settings?.(registered.info) ?? settingValues(registered.info); + try { + const detected = registered.detect(page, settings); + return ( + detected && + withSiteImage(stampClientId(registered, detected), registered.info, page.favicon) + ); + } catch { + // A broken Activity shows nothing rather than stopping detection for every other one. + return null; + } + } + + /** + * The Presence for `page`, or for no page at all (a browser page, a new + * tab): the page's own Activity, else music or video kept from another tab, + * else the fallback, if any. + */ resolve(page: Page | null): Presence { const external = page && this.options.external?.(); if (external) return createPresence(external); - const registered = page && this.find(page.url); - let activity: Activity | null = null; - if (page && registered) { - const settings = this.options.settings?.(registered.info) ?? settingValues(registered.info); - try { - const detected = registered.detect(page, settings); - activity = - detected && - withSiteImage(stampClientId(registered, detected), registered.info, page.favicon); - } catch { - // A broken Activity shows nothing rather than stopping detection for every other one. - } - } - return createPresence(activity ?? this.options.fallback?.() ?? null); + const own = page && this.detect(page); + return createPresence(own ?? this.options.media?.() ?? this.options.fallback?.() ?? null); } /** Whether `url` is a page some Activity looks at (so its title matters too). */ diff --git a/browser/src/core/site-access.ts b/browser/src/core/site-access.ts index 12dc3cd..42a999e 100644 --- a/browser/src/core/site-access.ts +++ b/browser/src/core/site-access.ts @@ -11,7 +11,7 @@ import { needsAccess } from "./activity-state"; export const ALL_SITES = "*://*/*"; export interface Grants { - /** "Access your data for all websites" is on. */ + /** "Allow access to all websites" is on. */ all: boolean; /** Each site granted on its own, as origin patterns (`*://www.youtube.com/*`). */ origins: readonly string[]; diff --git a/browser/src/core/ui-port.test.ts b/browser/src/core/ui-port.test.ts index 324e21b..4715eba 100644 --- a/browser/src/core/ui-port.test.ts +++ b/browser/src/core/ui-port.test.ts @@ -54,11 +54,19 @@ describe("ui-port messages", () => { activity: { id: "jena", name: "Jena Hub", configurable: true }, }), ).toEqual({ type: "activity", activity: { id: "jena", name: "Jena Hub", configurable: true } }); + expect( + parseUiEvent({ type: "activity", activity: { id: "tunes", name: "Tunes", kept: true } }), + ).toEqual({ type: "activity", activity: { id: "tunes", name: "Tunes", kept: true } }); + // Left out unless it is so. + expect( + parseUiEvent({ type: "activity", activity: { id: "tunes", name: "Tunes", kept: false } }), + ).toEqual({ type: "activity", activity: { id: "tunes", name: "Tunes" } }); expect(parseUiEvent({ type: "activity", activity: null })).toEqual({ type: "activity", activity: null, }); for (const value of [ + { type: "activity", activity: { id: "a", name: "A", kept: "yes" } }, { type: "activity", activity: { name: "No id" } }, { type: "activity", activity: { id: "x".repeat(257), name: "Long id" } }, { type: "activity", activity: { id: "a", name: "A", configurable: "yes" } }, diff --git a/browser/src/core/ui-port.ts b/browser/src/core/ui-port.ts index 4d34e54..1e996cb 100644 --- a/browser/src/core/ui-port.ts +++ b/browser/src/core/ui-port.ts @@ -33,6 +33,8 @@ export interface UiActivity { name: string; /** It has settings of its own, which the popup can show. */ configurable?: boolean; + /** It's music or video kept from another tab, not what the tab being shared has (see core/media-presence.ts). */ + kept?: boolean; details?: string; state?: string; /** Unix milliseconds. */ @@ -85,14 +87,18 @@ const optionalText = (value: unknown): value is string | undefined => function parseUiActivity(value: unknown): UiActivity | null | undefined { if (value === null) return null; if (typeof value !== "object") return undefined; - const { id, name, configurable, details, state, startedAt } = value as Record; + const { id, name, configurable, kept, details, state, startedAt } = value as Record< + string, + unknown + >; if ( typeof id !== "string" || id.length > 256 || typeof name !== "string" || !optionalText(details) || !optionalText(state) || - (configurable !== undefined && typeof configurable !== "boolean") + (configurable !== undefined && typeof configurable !== "boolean") || + (kept !== undefined && typeof kept !== "boolean") ) { return undefined; } @@ -103,6 +109,7 @@ function parseUiActivity(value: unknown): UiActivity | null | undefined { id, name, ...(configurable === true && { configurable }), + ...(kept === true && { kept }), ...(details !== undefined && { details }), ...(state !== undefined && { state }), ...(startedAt !== undefined && { startedAt }), diff --git a/browser/src/fullscreen/activities.ts b/browser/src/fullscreen/activities.ts index d6a4b2e..f8fa180 100644 --- a/browser/src/fullscreen/activities.ts +++ b/browser/src/fullscreen/activities.ts @@ -166,7 +166,8 @@ export function activitiesView(context: ViewContext, params: URLSearchParams): V pills.append(el("span", "pill pill-warn", t("Access declined"))); } if (info.source === "premid") pills.append(el("span", "pill pill-quiet", "PreMiD")); - if ((info.variants?.length ?? 0) > 1) pills.append(el("span", "pill pill-quiet", t("multi"))); + if ((info.variants?.length ?? 0) > 1) + pills.append(el("span", "pill pill-quiet", t("2 sources"))); link.append(activityIcon(info), text, pills); const toggle = el("input", "switch"); @@ -267,12 +268,12 @@ export function activitiesView(context: ViewContext, params: URLSearchParams): V for (const id of declined) refused.add(id); if (declined.length === 0) return t("Enabled {count}.", { count: count(changed) }); if (changed === 0) { - return t("Nothing was enabled: your browser didn't grant access to their sites."); + return t("Nothing was enabled. Your browser declined access to their sites."); } return tn( declined.length, "Enabled {count}. {n} Activity stayed off because its sites weren't granted.", - "Enabled {count}. {n} Activities stayed off because their sites weren't granted.", + "Enabled {count}. {n} Activities stayed off because access to their sites was declined.", { count: count(changed) }, ); }) @@ -308,8 +309,8 @@ export function activitiesView(context: ViewContext, params: URLSearchParams): V "p", "bulk-scope", arranged.length === 0 - ? t("No Activities match, so there is nothing to change.") - : t("This applies to the {count} matching your search and filters, on every page.", { + ? t("No Activities match, so there's nothing to change.") + : t("This applies to all {count} matching your search and filters, not only this page.", { count: count(arranged.length), }), ); @@ -326,9 +327,9 @@ export function activitiesView(context: ViewContext, params: URLSearchParams): V ? `${tn(readers, "{n} Activity reads pages.", "{n} Activities read pages.")} ${tn( sites, "Your browser will ask for access to {n} site in one prompt, which can be long. Anything you decline stays off.", - "Your browser will ask for access to {n} sites in one prompt, which can be long. Anything you decline stays off.", + "Your browser asks for access to {n} sites in one prompt. Anything you decline stays off.", )}` - : t("None of them needs access to a new site, so your browser won't ask for anything."), + : t("None needs access to a new site, so your browser won't ask."), ), ); const actions = el("div", "bulk-actions"); @@ -363,7 +364,7 @@ export function activitiesView(context: ViewContext, params: URLSearchParams): V ); bulkBody.replaceChildren( el("p", "bulk-question", t("Disable {count}?", { count: count(plan.disable.length) })), - el("p", "bulk-scope", t("Sites only they used are given back to your browser.")), + el("p", "bulk-scope", t("Sites only they use are given back to your browser.")), actions, ); if (moveFocus) cancel.focus(); diff --git a/browser/src/fullscreen/activity.ts b/browser/src/fullscreen/activity.ts index ae5534a..8563236 100644 --- a/browser/src/fullscreen/activity.ts +++ b/browser/src/fullscreen/activity.ts @@ -43,15 +43,18 @@ function sitesText(origins: readonly string[]): string { /** What turning it on means, next to its switch. */ function switchNote(info: ActivityInfo): string { if (!needsAccess(info)) { - return t("Reads only the address and title of its pages, so it needs no site access."); + return t("Reads only page addresses and titles, so it needs no site access."); } const sites = sitesText(info.origins ?? []); return info.source === "premid" - ? t("Its own code reads its pages. Turning it on asks your browser for access to {sites}.", { - sites, - }) + ? t( + "Its code reads the pages it runs on. Turning it on asks your browser for access to {sites}.", + { + sites, + }, + ) : t( - "Parousia reads what's playing on its pages. Turning it on asks your browser for access to {sites}.", + "Parousia reads what's playing on those pages. Turning it on asks your browser for access to {sites}.", { sites }, ); } @@ -117,16 +120,16 @@ export function activityView(context: ViewContext, id: string): View { const missing = missingSites(activity, grants); let text = ""; if (refused && status === "off") { - text = t("It stays off: your browser didn't allow access to {sites}.", { + text = t("It stays off: your browser declined access to {sites}.", { sites: sitesText(missing), }); } else if (refused && status === "needs-access") { - text = t("Your browser didn't allow access to {sites}, so it still doesn't run there.", { + text = t("Your browser declined access to {sites}, so it still doesn't run there.", { sites: sitesText(missing), }); } else if (status === "needs-access") { text = t( - "It's on, but can't read {sites}, so it doesn't run there. Access was declined or taken back.", + "It's on, but can't read {sites}, so it doesn't run there. Access was declined or revoked.", { sites: sitesText(missing) }, ); } @@ -194,7 +197,9 @@ export function activityView(context: ViewContext, id: string): View { for (const [term, value] of [ [t("Sites"), activity.hosts.join(", ")], [t("From"), t("{source} Activities", { source: SOURCES[activity.source] })], + [t("Version"), activity.version], ] as const) { + if (!value) continue; const row = el("div"); row.append(el("dt", "", term), el("dd", "", value)); facts.append(row); diff --git a/browser/src/fullscreen/default.ts b/browser/src/fullscreen/default.ts index f3a650e..a552c0f 100644 --- a/browser/src/fullscreen/default.ts +++ b/browser/src/fullscreen/default.ts @@ -74,10 +74,8 @@ export function defaultView(): View { let saved: DefaultActivity = EMPTY_DEFAULT_ACTIVITY; const toggle = switchRow( - t("Show a Default Activity"), - t( - "Shared whenever the tab you're on has no Activity: a site none covers, a browser page, a new tab.", - ), + t("Turn on the Default Activity"), + t("Shared when the tab has no Activity: a site none covers, a browser page, or a new tab."), (on) => void setEnabled(on), "default-on", ); @@ -95,31 +93,21 @@ export function defaultView(): View { largeImage: field( "default-largeImage", t("Large image"), - t("An https image link, or an asset name from your own Discord Application."), + t("An https image link, or an asset name from your Discord application."), image, ), - largeText: field( - "default-largeText", - t("Large image text"), - t("Shown when someone hovers over it."), - text, - ), + largeText: field("default-largeText", t("Large image text"), t("Shown on hover."), text), smallImage: field( "default-smallImage", t("Small image"), t("Shown in the large image's corner."), image, ), - smallText: field( - "default-smallText", - t("Small image text"), - t("Shown when someone hovers over it."), - text, - ), + smallText: field("default-smallText", t("Small image text"), t("Shown on hover."), text), discordClientId: field( "default-discordClientId", - t("Discord Application ID"), - t("Optional: show it as your own Discord Application instead of Parousia."), + t("Discord application ID"), + t("Optional. Show it as your own Discord application instead of Parousia."), 20, ), }; @@ -144,7 +132,7 @@ export function defaultView(): View { const elapsed = switchRow( t("Show elapsed time"), - t("How long it's been shown, counted from when it started."), + t("Counts up from when it started."), () => renderPreview(), "default-elapsed", ); @@ -261,13 +249,13 @@ export function defaultView(): View { event.preventDefault(); const activity = read(); if (!showProblems(activity)) { - status.textContent = t("Not saved: fix what's marked."); + status.textContent = t("Not saved. Fix the marked fields."); return; } void saveDefaultActivity(activity).then((next) => { fill(next); status.textContent = next.enabled - ? t("Saved. It's shown when no Activity is.") + ? t("Saved. It shows when no Activity has anything to share.") : t("Saved. Turn it on above to share it."); }); }); diff --git a/browser/src/fullscreen/fullscreen.html b/browser/src/fullscreen/fullscreen.html index d07571c..a209cd2 100644 --- a/browser/src/fullscreen/fullscreen.html +++ b/browser/src/fullscreen/fullscreen.html @@ -62,7 +62,7 @@

Overview

Get Parousia Desktop - + @@ -75,7 +75,7 @@

Overview

- +
@@ -189,7 +189,7 @@

Activities

    @@ -198,8 +198,7 @@

    Activities

    No Activities in this build yet

    - Until one is added, Parousia recognizes no sites, so nothing about your browsing is - shared. + Until one is added, Parousia recognizes no sites and shares nothing from your browsing.

    @@ -236,7 +235,8 @@

    Default Activity

    - What to share when the tab you're on has no Activity. Privacy settings and Settings - > Platforms apply to it, as to any Activity. + What to share when the tab has no Activity. Privacy settings and Settings > + Platforms apply to it, as they do to any Activity.

    @@ -288,7 +288,7 @@

    Settings

    - How Parousia behaves in this browser, and Parousia Desktop's own settings. + How Parousia behaves in this browser, and Parousia Desktop's settings.

    diff --git a/browser/src/locales/de.json b/browser/src/locales/de.json index bea113e..a2a9696 100644 --- a/browser/src/locales/de.json +++ b/browser/src/locales/de.json @@ -2,23 +2,23 @@ "Off": "Aus", "1 h": "1 Std.", "{n} min": "{n} Min.", - "Give it a name of at least 2 characters.": "Gib ihr einen Namen mit mindestens 2 Zeichen.", - "Discord leaves out lines under 2 characters.": "Discord lässt Zeilen mit weniger als 2 Zeichen weg.", - "Use an https image link, or an asset name from your own Discord Application.": "Verwende einen https-Bildlink oder den Namen eines Assets deiner eigenen Discord-Anwendung.", + "Use a name of at least 2 characters.": "Verwende einen Namen mit mindestens 2 Zeichen.", + "Discord drops lines shorter than 2 characters.": "Discord lässt Zeilen mit weniger als 2 Zeichen weg.", + "Use an https image link, or an asset name from your Discord application.": "Verwende einen https-Bildlink oder den Namen eines Assets deiner Discord-Anwendung.", "A button needs both a label and a link.": "Eine Schaltfläche braucht eine Beschriftung und einen Link.", - "Button links start with https:// or http://.": "Links von Schaltflächen beginnen mit https:// oder http://.", - "A Discord Application ID is 17 to 20 digits.": "Eine Discord-Anwendungs-ID besteht aus 17 bis 20 Ziffern.", - "{name} is on. Nothing to share on this page yet.": "{name} ist aktiv. Auf dieser Seite gibt es noch nichts zu teilen.", - "Nothing to share on this page.": "Auf dieser Seite gibt es nichts zu teilen.", - "Your browser didn't allow access to its sites, so it stays off.": "Dein Browser hat den Zugriff auf ihre Websites nicht erlaubt, deshalb bleibt sie aus.", - "An Activity for this site, turned off. Turning it on asks your browser for access to {sites}.": "Für diese Website gibt es eine Aktivität, die ausgeschaltet ist. Beim Einschalten fragt dein Browser nach Zugriff auf {sites}.", - "An Activity for this site, turned off.": "Für diese Website gibt es eine Aktivität, die ausgeschaltet ist.", + "Button links must start with https:// or http://.": "Links von Schaltflächen müssen mit https:// oder http:// beginnen.", + "A Discord application ID is 17 to 20 digits.": "Eine Discord-Anwendungs-ID hat 17 bis 20 Ziffern.", + "{name} is on. Nothing to share here yet.": "{name} ist aktiv. Hier gibt es noch nichts zu teilen.", + "Nothing to share here.": "Hier gibt es nichts zu teilen.", + "Your browser declined access to its sites, so it stays off.": "Dein Browser hat den Zugriff auf ihre Websites abgelehnt, deshalb bleibt sie aus.", + "There's an Activity for this site, and it's off. Turning it on asks your browser for access to {sites}.": "Für diese Website gibt es eine Aktivität, und sie ist aus. Zum Einschalten fragt dein Browser nach Zugriff auf {sites}.", + "There's an Activity for this site, and it's off.": "Für diese Website gibt es eine Aktivität, und sie ist aus.", "Turn on": "Einschalten", - "Your browser didn't allow access to {sites}, so it still can't run here.": "Dein Browser hat den Zugriff auf {sites} nicht erlaubt, deshalb kann sie hier weiterhin nicht laufen.", - "It's on, but your browser hasn't given it access to {sites}, so it can't run here.": "Sie ist eingeschaltet, aber dein Browser hat ihr keinen Zugriff auf {sites} gegeben, deshalb kann sie hier nicht laufen.", + "Your browser declined access to {sites}, so it still can't run here.": "Dein Browser hat den Zugriff auf {sites} abgelehnt, deshalb läuft sie hier weiterhin nicht.", + "It's on, but it has no access to {sites}, so it can't run here.": "Die Aktivität ist an, hat aber keinen Zugriff auf {sites} und läuft deshalb hier nicht.", "Allow access": "Zugriff erlauben", - "Show a Default Activity": "Eine Standardaktivität anzeigen", - "Shared whenever the tab you're on has no Activity: a site none covers, a browser page, a new tab.": "Wird geteilt, wenn der aktuelle Tab keine Aktivität hat: eine Website, die keine abdeckt, eine Browserseite, ein neuer Tab.", + "Turn on the Default Activity": "Standardaktivität einschalten", + "Shared when the tab has no Activity: a site none covers, a browser page, or a new tab.": "Wird geteilt, wenn der Tab keine Aktivität hat: eine Website ohne Aktivität, eine Browserseite oder ein neuer Tab.", "Name": "Name", "Shown as what you're doing, like \"Playing \". Required.": "Wird als das angezeigt, was du gerade tust, z. B. „Spielt “. Erforderlich.", "Details": "Details", @@ -26,20 +26,20 @@ "State": "Status", "The second line.": "Die zweite Zeile.", "Large image": "Großes Bild", - "An https image link, or an asset name from your own Discord Application.": "Ein https-Bildlink oder der Name eines Assets deiner eigenen Discord-Anwendung.", + "An https image link, or an asset name from your Discord application.": "Ein https-Bildlink oder der Name eines Assets deiner Discord-Anwendung.", "Large image text": "Text des großen Bildes", - "Shown when someone hovers over it.": "Wird angezeigt, wenn jemand mit der Maus darüberfährt.", + "Shown on hover.": "Wird beim Darüberfahren angezeigt.", "Small image": "Kleines Bild", "Shown in the large image's corner.": "Wird in der Ecke des großen Bildes angezeigt.", "Small image text": "Text des kleinen Bildes", - "Discord Application ID": "Discord-Anwendungs-ID", - "Optional: show it as your own Discord Application instead of Parousia.": "Optional: als deine eigene Discord-Anwendung statt als Parousia anzeigen.", + "Discord application ID": "Discord-Anwendungs-ID", + "Optional. Show it as your own Discord application instead of Parousia.": "Optional. Zeige sie als deine eigene Discord-Anwendung statt Parousia an.", "Button {n}": "Schaltfläche {n}", "Its label.": "Ihre Beschriftung.", "Button {n} link": "Link der Schaltfläche {n}", "Where it goes.": "Wohin sie führt.", "Show elapsed time": "Verstrichene Zeit anzeigen", - "How long it's been shown, counted from when it started.": "Wie lange sie schon angezeigt wird, gezählt ab dem Beginn.", + "Counts up from when it started.": "Zählt ab dem Start.", "Text": "Text", "Images": "Bilder", "Buttons": "Schaltflächen", @@ -48,19 +48,19 @@ "Fix what's marked, then turn it on.": "Korrigiere die markierten Felder und schalte sie dann ein.", "On.": "An.", "Off.": "Aus.", - "Not saved: fix what's marked.": "Nicht gespeichert: Korrigiere die markierten Felder.", - "Saved. It's shown when no Activity is.": "Gespeichert. Sie wird angezeigt, wenn keine Aktivität erkannt wird.", + "Not saved. Fix the marked fields.": "Nicht gespeichert. Korrigiere die markierten Felder.", + "Saved. It shows when no Activity has anything to share.": "Gespeichert. Angezeigt wird sie, wenn keine Aktivität etwas zu teilen hat.", "Saved. Turn it on above to share it.": "Gespeichert. Schalte sie oben ein, um sie zu teilen.", "Default Activity": "Standardaktivität", "{first} and {second}": "{first} und {second}", "{first}, {second}, and {n} more": "{first}, {second} und {n} weitere", - "Reads only the address and title of its pages, so it needs no site access.": "Liest nur Adresse und Titel ihrer Seiten, deshalb braucht sie keinen Website-Zugriff.", - "Its own code reads its pages. Turning it on asks your browser for access to {sites}.": "Ihr eigener Code liest ihre Seiten. Beim Einschalten fragt dein Browser nach Zugriff auf {sites}.", - "Parousia reads what's playing on its pages. Turning it on asks your browser for access to {sites}.": "Parousia liest, was auf ihren Seiten gerade wiedergegeben wird. Beim Einschalten fragt dein Browser nach Zugriff auf {sites}.", + "Reads only page addresses and titles, so it needs no site access.": "Liest nur Seitenadressen und -titel, daher braucht sie keinen Website-Zugriff.", + "Its code reads the pages it runs on. Turning it on asks your browser for access to {sites}.": "Der Code der Aktivität liest die Seiten, auf denen sie läuft. Zum Einschalten fragt dein Browser nach Zugriff auf {sites}.", + "Parousia reads what's playing on those pages. Turning it on asks your browser for access to {sites}.": "Parousia liest, was auf diesen Seiten läuft. Zum Einschalten fragt dein Browser nach Zugriff auf {sites}.", "Show this Activity": "Diese Aktivität anzeigen", - "It stays off: your browser didn't allow access to {sites}.": "Sie bleibt aus: Dein Browser hat den Zugriff auf {sites} nicht erlaubt.", - "Your browser didn't allow access to {sites}, so it still doesn't run there.": "Dein Browser hat den Zugriff auf {sites} nicht erlaubt, deshalb läuft sie dort weiterhin nicht.", - "It's on, but can't read {sites}, so it doesn't run there. Access was declined or taken back.": "Sie ist eingeschaltet, kann {sites} aber nicht lesen und läuft deshalb dort nicht. Der Zugriff wurde abgelehnt oder zurückgenommen.", + "It stays off: your browser declined access to {sites}.": "Die Aktivität bleibt aus: Dein Browser hat den Zugriff auf {sites} abgelehnt.", + "Your browser declined access to {sites}, so it still doesn't run there.": "Dein Browser hat den Zugriff auf {sites} abgelehnt, deshalb läuft sie dort weiterhin nicht.", + "It's on, but can't read {sites}, so it doesn't run there. Access was declined or revoked.": "Die Aktivität ist an, kann aber {sites} nicht lesen und läuft deshalb nicht. Der Zugriff wurde abgelehnt oder entzogen.", "PreMiD: {name}": "PreMiD: {name}", "Sites": "Websites", "From": "Herkunft", @@ -68,24 +68,24 @@ "Activity": "Aktivität", "Needs access": "Zugriff nötig", "Access declined": "Zugriff abgelehnt", - "multi": "mehrere", + "2 sources": "2 Quellen", "Show {name}": "{name} anzeigen", "Filter, {n} selected": "Filter, {n} ausgewählt", "Filter": "Filter", "Enabled {count}.": "Aktiviert: {count}.", - "Nothing was enabled: your browser didn't grant access to their sites.": "Nichts wurde aktiviert: Dein Browser hat den Zugriff auf ihre Websites nicht gewährt.", + "Nothing was enabled. Your browser declined access to their sites.": "Nichts wurde aktiviert. Dein Browser hat den Zugriff auf ihre Websites abgelehnt.", "Couldn't change the Activities. Try again.": "Die Aktivitäten konnten nicht geändert werden. Versuche es erneut.", "Nothing was on.": "Nichts war eingeschaltet.", "Disabled {count}.": "Deaktiviert: {count}.", - "No Activities match, so there is nothing to change.": "Keine Aktivität passt, also gibt es nichts zu ändern.", - "This applies to the {count} matching your search and filters, on every page.": "Das gilt für die {count}, die zu deiner Suche und deinen Filtern passen, auf allen Seiten.", + "No Activities match, so there's nothing to change.": "Keine Aktivität passt, daher gibt es nichts zu ändern.", + "This applies to all {count} matching your search and filters, not only this page.": "Das gilt für alle {count} Treffer deiner Suche und Filter, nicht nur für diese Seite.", "Enable {count}?": "{count} aktivieren?", - "None of them needs access to a new site, so your browser won't ask for anything.": "Keine davon braucht Zugriff auf eine neue Website, deshalb fragt dein Browser nach nichts.", + "None needs access to a new site, so your browser won't ask.": "Keine davon braucht Zugriff auf eine neue Website, daher fragt dein Browser nicht.", "Cancel": "Abbrechen", "Enable {count}": "{count} aktivieren", "Disable {count}": "{count} deaktivieren", "Disable {count}?": "{count} deaktivieren?", - "Sites only they used are given back to your browser.": "Websites, die nur sie genutzt haben, werden an deinen Browser zurückgegeben.", + "Sites only they use are given back to your browser.": "Websites, die nur sie nutzen, werden an deinen Browser zurückgegeben.", "Enable all ({n})": "Alle aktivieren ({n})", "Disable all ({n})": "Alle deaktivieren ({n})", "{first}–{last} of {total}": "{first}–{last} von {total}", @@ -100,7 +100,7 @@ "Appearance": "Darstellung", "Theme": "Design", "Privacy": "Datenschutz", - "What's shared, what Activities read, incognito": "Was geteilt wird, was Aktivitäten lesen, Inkognito", + "What's shared, what Activities read, private windows": "Was geteilt wird, was Aktivitäten lesen, Privatfenster", "Site access": "Website-Zugriff", "Access to all websites": "Zugriff auf alle Websites", "Platforms": "Plattformen", @@ -112,7 +112,7 @@ "What's playing": "Wiedergabe", "Titles, artists, and progress of what you're watching or listening to.": "Titel, Künstler und Fortschritt dessen, was du ansiehst oder hörst.", "Thumbnails": "Vorschaubilder", - "Images of what you're watching or reading, such as a video's thumbnail or an album cover.": "Bilder dessen, was du ansiehst oder liest, etwa das Vorschaubild eines Videos oder ein Albumcover.", + "Images of what you're watching or reading, like a video thumbnail or album cover.": "Bilder von dem, was du ansiehst oder liest, etwa ein Videovorschaubild oder ein Albumcover.", "Creator icons": "Symbole von Urhebern", "Pictures of the channel, artist, or creator.": "Bilder des Kanals, Künstlers oder Urhebers.", "Atelier": "Atelier", @@ -124,42 +124,44 @@ "Automatic": "Automatisch", "Connect to Parousia Desktop to see and change these.": "Verbinde dich mit Parousia Desktop, um diese Einstellungen zu sehen und zu ändern.", "Allow userscripts": "Userscripts erlauben", - "Any web page can connect while this is on. Userscripts can only publish presence, never read status or change settings.": "Solange dies eingeschaltet ist, kann sich jede Webseite verbinden. Userscripts können nur Präsenz veröffentlichen, niemals den Status lesen oder Einstellungen ändern.", - "Parousia Desktop couldn't confirm this connection is yours, so these can't be changed from here. Use the Parousia-Desktop set command or Desktop's own console instead.": "Parousia Desktop konnte nicht bestätigen, dass diese Verbindung deine ist, deshalb lassen sich diese Einstellungen hier nicht ändern. Verwende stattdessen den Befehl „Parousia-Desktop set“ oder die Konsole von Desktop.", + "Any web page can connect while this is on. Userscripts can only send presence, not read status or change settings.": "Solange das an ist, kann sich jede Webseite verbinden. Userskripte können nur Präsenz senden, aber weder den Status lesen noch Einstellungen ändern.", + "Parousia Desktop couldn't confirm this connection is yours, so you can't change these here. Use the Parousia-Desktop set command or Desktop's console instead.": "Parousia Desktop konnte nicht bestätigen, dass diese Verbindung deine ist, daher kannst du diese Einstellungen hier nicht ändern. Nutze stattdessen den Befehl Parousia-Desktop set oder die Konsole von Desktop.", "Language": "Sprache", - "Changing it reloads any open Parousia page.": "Beim Ändern werden alle geöffneten Parousia-Seiten neu geladen.", + "Open Parousia pages reload when you change it.": "Beim Ändern werden geöffnete Parousia-Seiten neu geladen.", "Parousia Desktop": "Parousia Desktop", - "Share Media Details": "Mediendetails teilen", - "Include what you're watching or reading, not just the site's name.": "Teile auch, was du ansiehst oder liest, nicht nur den Namen der Website.", + "Share media details": "Mediendetails teilen", + "Include what you're watching or reading, not only the site's name.": "Teile auch, was du ansiehst oder liest, nicht nur den Namen der Website.", + "Show media presence": "Medienpräsenz anzeigen", + "Keep showing music and video activity when switching to websites without an enabled Activity.": "Zeige Musik und Videos weiter an, wenn du zu Websites ohne aktivierte Aktivität wechselst.", "Shorter": "Kürzer", "Longer": "Länger", "Pause activity": "Aktivität pausieren", "Share as usual": "Wie gewohnt teilen", - "Incognito Behaviour": "Verhalten im Inkognitomodus", - "What to do in private windows, if you've allowed Parousia there.": "Was in privaten Fenstern passiert, wenn du Parousia dort erlaubt hast.", + "Private windows": "Privatfenster", + "What to do in private windows you've allowed Parousia in.": "Was in Privatfenstern passiert, in denen du Parousia erlaubt hast.", "What leaves your browser": "Was deinen Browser verlässt", - "Idle Timeout": "Inaktivitäts-Timeout", - "Keep sharing this long after you switch away from the browser. Sound playing keeps it going.": "Teile so lange weiter, nachdem du den Browser verlassen hast. Wiedergegebener Ton hält das Teilen aufrecht.", + "Idle timeout": "Inaktivitäts-Timeout", + "Keep sharing this long after you leave the browser. Sound keeps it going.": "Teile so lange weiter, nachdem du den Browser verlassen hast. Ton, der gerade läuft, hält das Teilen aufrecht.", "What Activities may read": "Was Aktivitäten lesen dürfen", - "On sites you've granted, Activities that read pages may take these. Switched off, Parousia doesn't read them, and doesn't show what an Activity's own code read.": "Auf Websites, für die du den Zugriff erlaubt hast, dürfen Aktivitäten, die Seiten lesen, diese Daten verwenden. Ausgeschaltet liest Parousia sie nicht und zeigt auch nicht an, was der eigene Code einer Aktivität gelesen hat.", + "On sites you've allowed, Activities that read pages may use these. When switched off, Parousia reads none of them and shows no page data from Activities.": "Auf Websites, die du erlaubt hast, dürfen Aktivitäten, die Seiten lesen, diese nutzen. Ausgeschaltet liest Parousia keine davon und zeigt keine Seitendaten aus Aktivitäten.", "{name} Rich Presence": "{name} Rich Presence", - "Show your activity on {name}.": "Deine Aktivität auf {name} anzeigen.", - "Parousia Desktop shows your activity on these apps. Discord works now. Fluxer doesn't yet let other apps show activity on your profile, and Stoat is still being built, so those choices are saved for when they arrive.": "Parousia Desktop zeigt deine Aktivität in diesen Apps an. Discord funktioniert schon jetzt. Fluxer erlaubt anderen Apps noch nicht, Aktivitäten in deinem Profil anzuzeigen, und Stoat befindet sich noch im Aufbau. Diese Auswahl wird daher gespeichert, bis sie so weit sind.", + "Show your presence on {name}.": "Deine Präsenz auf {name} anzeigen.", + "Parousia Desktop shows your presence on these apps. Discord works now. Fluxer doesn't let other apps show presence yet, and Stoat is still being built. Choices for them are saved until they arrive.": "Parousia Desktop zeigt deine Präsenz in diesen Apps. Discord funktioniert schon. Fluxer lässt andere Apps noch keine Präsenz im Profil anzeigen, und Stoat wird noch entwickelt. Deine Auswahl dafür wird bis dahin gespeichert.", "Discord-RPC-Extension": "Discord-RPC-Extension", - "Show Discord presence through Discord-RPC-Extension's app (discord_rpc_ext) on this computer, when it's running. Rich Presence only: nothing else is sent to it or accepted from it.": "Discord-Präsenz über die App von Discord-RPC-Extension (discord_rpc_ext) auf diesem Computer anzeigen, wenn sie läuft. Nur Rich Presence: Es wird nichts anderes an sie gesendet oder von ihr angenommen.", + "Use Discord-RPC-Extension's app (discord_rpc_ext) on this computer when it's running. Only Rich Presence is sent to it or accepted from it.": "Verwende die App von Discord-RPC-Extension (discord_rpc_ext) auf diesem Computer, solange sie läuft. An sie wird nur Rich Presence gesendet, und von ihr wird nur Rich Presence angenommen.", "Presence platforms": "Präsenz-Plattformen", "Discord without Parousia Desktop": "Discord ohne Parousia Desktop", "Other extensions": "Andere Erweiterungen", - "Show what MAL-Sync recognizes on anime and manga sites as your activity there, in place of the site's own. Parousia asks the MAL-Sync extension about the tab you're on and takes only Rich Presence from it. Turn off MAL-Sync's own Discord Rich Presence setting so it isn't shown twice.": "Zeigt als deine Aktivität, was MAL-Sync auf Anime- und Manga-Seiten erkennt, anstelle der seitenspezifischen Aktivität. Parousia fragt die MAL-Sync-Erweiterung zum aktuellen Tab und übernimmt von ihr nur Rich Presence. Schalte die eigene Discord-Rich-Presence-Einstellung von MAL-Sync aus, damit sie nicht doppelt erscheint.", + "Show what MAL-Sync recognizes on anime and manga sites in place of the site's own. Parousia takes only Rich Presence from MAL-Sync. Turn off MAL-Sync's Discord Rich Presence setting so it isn't shown twice.": "Zeige an Anime- und Manga-Websites, was MAL-Sync erkennt, anstelle der Aktivität der Website. Parousia übernimmt nur Rich Presence von MAL-Sync. Schalte die Discord-Rich-Presence-Einstellung von MAL-Sync aus, damit sie nicht doppelt angezeigt wird.", "Parousia Desktop: {status}": "Parousia Desktop: {status}", "Off while Discord Rich Presence is off": "Aus, solange Discord Rich Presence aus ist", "Standing by while Parousia Desktop shows Discord": "Wartet, solange Parousia Desktop Discord anzeigt", - "Access your data for all websites": "Auf deine Daten auf allen Websites zugreifen", - "Off by default. With it on, Activities that read pages can read any site, without asking site by site. Parousia never turns it on by itself.": "Standardmäßig aus. Eingeschaltet können Aktivitäten, die Seiten lesen, jede Website lesen, ohne Website für Website nachzufragen. Parousia schaltet das nie von selbst ein.", + "Allow access to all websites": "Zugriff auf alle Websites erlauben", + "Off by default. With it on, Activities that read pages can read any site without asking for each one. Parousia never turns it on by itself.": "Standardmäßig aus. Wenn es an ist, können Aktivitäten, die Seiten lesen, jede Website lesen, ohne für jede einzeln nachzufragen. Parousia schaltet es nie von selbst ein.", "All websites": "Alle Websites", - "Otherwise your browser asks before an Activity reads a site, when you turn the Activity on. Sites you allowed are managed in your browser's settings for this extension.": "Andernfalls fragt dein Browser nach, bevor eine Aktivität eine Website liest, nämlich wenn du die Aktivität einschaltest. Erlaubte Websites verwaltest du in den Einstellungen deines Browsers für diese Erweiterung.", + "Otherwise, your browser asks before an Activity reads a site, when you turn the Activity on. Manage the sites you've allowed in your browser's settings for this extension.": "Ansonsten fragt dein Browser, bevor eine Aktivität eine Website liest, wenn du die Aktivität einschaltest. Erlaubte Websites verwaltest du in den Browser-Einstellungen für diese Erweiterung.", "Change in the dashboard": "Im Dashboard ändern", - "Your browser asks before granting access, which it does from the dashboard.": "Dein Browser fragt vor der Zugriffserlaubnis nach, und zwar im Dashboard.", + "Your browser asks for access from the dashboard.": "Dein Browser fragt im Dashboard nach dem Zugriff.", "Coming soon": "Demnächst verfügbar", "Link accounts such as Jena Cloud to share presence without Parousia Desktop.": "Verknüpfe Konten wie Jena Cloud, um Präsenz ohne Parousia Desktop zu teilen.", "Extension": "Erweiterung", @@ -187,9 +189,9 @@ "Versions don't match": "Die Versionen passen nicht zusammen", "This extension and Parousia Desktop are different major versions. Update whichever is older.": "Diese Erweiterung und Parousia Desktop haben unterschiedliche Hauptversionen. Aktualisiere die ältere.", "Parousia Desktop couldn't be found": "Parousia Desktop wurde nicht gefunden", - "Launch Parousia Desktop to share your browser activity.": "Starte Parousia Desktop, um deine Browseraktivität zu teilen.", + "Launch Parousia Desktop to share your presence.": "Starte Parousia Desktop, um deine Präsenz zu teilen.", "Showing {activity}": "Zeigt {activity}", - "Showing your activity": "Zeigt deine Aktivität", + "Showing your presence": "Deine Präsenz wird angezeigt", "Ready": "Bereit", "Connecting…": "Verbinden …", "Not running": "Läuft nicht", @@ -197,21 +199,21 @@ "Refused": "Abgelehnt", "Connected, v{version}": "Verbunden, v{version}", "Looking for it…": "Suche läuft …", - "No activity detected": "Keine Aktivität erkannt", - "Browse a supported site and it shows up here.": "Besuche eine unterstützte Website, und sie erscheint hier.", + "No Activity detected": "Keine Aktivität erkannt", + "Visit a supported site and it appears here.": "Besuche eine unterstützte Website, dann erscheint sie hier.", "Sharing {name}": "{name} wird geteilt", "Sharing now": "Wird gerade geteilt", "{time} elapsed": "{time} verstrichen", "Update Parousia Desktop": "Parousia Desktop aktualisieren", "Get Parousia Desktop": "Parousia Desktop herunterladen", "Checking…": "Prüfen …", - "Retry Connection": "Verbindung erneut versuchen", - "Discord-RPC-Extension is running, so Discord can still show your activity without Parousia Desktop.": "Discord-RPC-Extension läuft, deshalb kann Discord deine Aktivität auch ohne Parousia Desktop anzeigen.", + "Retry connection": "Verbindung erneut versuchen", + "Discord-RPC-Extension is running, so Discord can still show your presence without Parousia Desktop.": "Discord-RPC-Extension läuft, daher kann Discord deine Präsenz auch ohne Parousia Desktop anzeigen.", "Parousia": "Parousia", "PAROUSIA": "PAROUSIA", "Settings": "Einstellungen", - "Current activity": "Aktuelle Aktivität", - "Configure activity": "Aktivität konfigurieren", + "Now sharing": "Wird gerade geteilt", + "Configure Activity": "Aktivität konfigurieren", "PreMiD": "PreMiD", "Preferences": "Einstellungen", "Changes apply right away.": "Änderungen werden sofort übernommen.", @@ -235,17 +237,17 @@ "PreMiD Activities": "PreMiD-Aktivitäten", "Clear filters": "Filter zurücksetzen", "Enable or disable all…": "Alle aktivieren oder deaktivieren …", - "Nothing matches that search and those filters.": "Zu dieser Suche und diesen Filtern passt nichts.", + "Nothing matches your search and filters.": "Nichts passt zu deiner Suche und deinen Filtern.", "No Activities in this build yet": "Noch keine Aktivitäten in dieser Version", - "Until one is added, Parousia recognizes no sites, so nothing about your browsing is shared.": "Solange keine hinzugefügt ist, erkennt Parousia keine Websites, deshalb wird nichts über dein Surfen geteilt.", + "Until one is added, Parousia recognizes no sites and shares nothing from your browsing.": "Solange keine hinzugefügt ist, erkennt Parousia keine Websites und teilt nichts von deinem Surfen.", "All Activities": "Alle Aktivitäten", "Implementation": "Umsetzung", - "Both Parousia and PreMiD have an Activity for this website. Only the one chosen runs.": "Sowohl Parousia als auch PreMiD haben eine Aktivität für diese Website. Nur die gewählte läuft.", + "Parousia and PreMiD both have an Activity for this website. Only the one you choose runs.": "Parousia und PreMiD haben beide eine Aktivität für diese Website. Nur die von dir gewählte läuft.", "This Activity isn't in this build": "Diese Aktivität ist nicht in dieser Version enthalten", "It may have been removed, or come from another version of Parousia.": "Sie wurde möglicherweise entfernt oder stammt aus einer anderen Version von Parousia.", - "What to share when the tab you're on has no Activity. Privacy settings and Settings > Platforms apply to it, as to any Activity.": "Was geteilt wird, wenn der aktuelle Tab keine Aktivität hat. Die Datenschutzeinstellungen und Einstellungen > Plattformen gelten dafür wie für jede Aktivität.", + "What to share when the tab has no Activity. Privacy settings and Settings > Platforms apply to it, as they do to any Activity.": "Was geteilt wird, wenn der Tab keine Aktivität hat. Datenschutzeinstellungen und Einstellungen > Plattformen gelten dafür wie für jede Aktivität.", "Preview": "Vorschau", - "How Parousia behaves in this browser, and Parousia Desktop's own settings.": "Wie sich Parousia in diesem Browser verhält, und die eigenen Einstellungen von Parousia Desktop.", + "How Parousia behaves in this browser, and Parousia Desktop's settings.": "Wie sich Parousia in diesem Browser verhält, und die eigenen Einstellungen von Parousia Desktop.", "Dashboard": "Dashboard", "Search Activities or sites": "Aktivitäten oder Websites durchsuchen", "Filter Activities": "Aktivitäten filtern", @@ -253,24 +255,24 @@ "Activity pages": "Aktivitätsseiten", "Settings categories": "Einstellungskategorien", "A newer Parousia Desktop is available": "Eine neuere Version von Parousia Desktop ist verfügbar", - "This extension is newer than Parousia Desktop {version}. They still work together; update Desktop to get everything the extension offers.": "Diese Erweiterung ist neuer als Parousia Desktop {version}. Beide funktionieren weiterhin zusammen; aktualisiere Desktop, um alles zu nutzen, was die Erweiterung bietet.", + "This extension is newer than Parousia Desktop {version}. They still work together. Update Desktop to get everything the extension offers.": "Diese Erweiterung ist neuer als Parousia Desktop {version}. Beide funktionieren weiterhin zusammen; aktualisiere Desktop, um alles zu nutzen, was die Erweiterung bietet.", "A newer Parousia extension is available": "Eine neuere Version der Parousia-Erweiterung ist verfügbar", - "Parousia Desktop {version} is newer than this extension. They still work together; update the extension from your browser's extension page.": "Parousia Desktop {version} ist neuer als diese Erweiterung. Beide funktionieren weiterhin zusammen; aktualisiere die Erweiterung auf der Erweiterungsseite deines Browsers.", + "Parousia Desktop {version} is newer than this extension. They still work together. Update the extension from your browser's extension page.": "Parousia Desktop {version} ist neuer als diese Erweiterung. Beide funktionieren weiterhin zusammen; aktualisiere die Erweiterung auf der Erweiterungsseite deines Browsers.", "Not now": "Jetzt nicht", "{n} Activities": { "one": "{n} Aktivität", "other": "{n} Aktivitäten" }, - "Enabled {count}. {n} Activities stayed off because their sites weren't granted.": { - "one": "Aktiviert: {count}. {n} Aktivität blieb aus, weil ihre Websites nicht erlaubt wurden.", - "other": "Aktiviert: {count}. {n} Aktivitäten blieben aus, weil ihre Websites nicht erlaubt wurden." + "Enabled {count}. {n} Activities stayed off because access to their sites was declined.": { + "one": "Aktiviert: {count}. {n} Aktivität blieb aus, weil der Zugriff auf ihre Websites abgelehnt wurde.", + "other": "Aktiviert: {count}. {n} Aktivitäten blieben aus, weil der Zugriff auf ihre Websites abgelehnt wurde." }, "{n} Activities read pages.": { "one": "{n} Aktivität liest Seiten.", "other": "{n} Aktivitäten lesen Seiten." }, - "Your browser will ask for access to {n} sites in one prompt, which can be long. Anything you decline stays off.": { - "one": "Dein Browser fragt in einer einzigen Abfrage nach Zugriff auf {n} Website, was lang werden kann. Alles, was du ablehnst, bleibt aus.", - "other": "Dein Browser fragt in einer einzigen Abfrage nach Zugriff auf {n} Websites, was lang werden kann. Alles, was du ablehnst, bleibt aus." + "Your browser asks for access to {n} sites in one prompt. Anything you decline stays off.": { + "one": "Dein Browser fragt in einer einzigen Abfrage nach Zugriff auf {n} Website. Alles, was du ablehnst, bleibt aus.", + "other": "Dein Browser fragt in einer einzigen Abfrage nach Zugriff auf {n} Websites. Alles, was du ablehnst, bleibt aus." } } diff --git a/browser/src/locales/fr.json b/browser/src/locales/fr.json index 490a97b..973a8ff 100644 --- a/browser/src/locales/fr.json +++ b/browser/src/locales/fr.json @@ -2,23 +2,23 @@ "Off": "Désactivé", "1 h": "1 h", "{n} min": "{n} min", - "Give it a name of at least 2 characters.": "Donnez-lui un nom d’au moins 2 caractères.", - "Discord leaves out lines under 2 characters.": "Discord ignore les lignes de moins de 2 caractères.", - "Use an https image link, or an asset name from your own Discord Application.": "Utilisez un lien d’image https, ou le nom d’une ressource de votre propre application Discord.", + "Use a name of at least 2 characters.": "Utilisez un nom d’au moins 2 caractères.", + "Discord drops lines shorter than 2 characters.": "Discord supprime les lignes de moins de 2 caractères.", + "Use an https image link, or an asset name from your Discord application.": "Utilisez un lien https vers une image, ou le nom d’un asset de votre application Discord.", "A button needs both a label and a link.": "Un bouton a besoin d’un libellé et d’un lien.", - "Button links start with https:// or http://.": "Les liens des boutons commencent par https:// ou http://.", - "A Discord Application ID is 17 to 20 digits.": "L’identifiant d’une application Discord compte de 17 à 20 chiffres.", - "{name} is on. Nothing to share on this page yet.": "{name} est activée. Rien à partager sur cette page pour l’instant.", - "Nothing to share on this page.": "Rien à partager sur cette page.", - "Your browser didn't allow access to its sites, so it stays off.": "Votre navigateur n’a pas autorisé l’accès à ses sites : elle reste désactivée.", - "An Activity for this site, turned off. Turning it on asks your browser for access to {sites}.": "Une activité existe pour ce site, mais elle est désactivée. L’activer demande à votre navigateur l’accès à {sites}.", - "An Activity for this site, turned off.": "Une activité existe pour ce site, mais elle est désactivée.", + "Button links must start with https:// or http://.": "Les liens des boutons doivent commencer par https:// ou http://.", + "A Discord application ID is 17 to 20 digits.": "Un identifiant d’application Discord compte de 17 à 20 chiffres.", + "{name} is on. Nothing to share here yet.": "{name} est activée. Rien à partager ici pour l’instant.", + "Nothing to share here.": "Rien à partager ici.", + "Your browser declined access to its sites, so it stays off.": "Votre navigateur a refusé l’accès à ses sites, elle reste donc désactivée.", + "There's an Activity for this site, and it's off. Turning it on asks your browser for access to {sites}.": "Une activité existe pour ce site, et elle est désactivée. L’activer demande l’accès à {sites} à votre navigateur.", + "There's an Activity for this site, and it's off.": "Une activité existe pour ce site, et elle est désactivée.", "Turn on": "Activer", - "Your browser didn't allow access to {sites}, so it still can't run here.": "Votre navigateur n’a pas autorisé l’accès à {sites} : elle ne peut toujours pas fonctionner ici.", - "It's on, but your browser hasn't given it access to {sites}, so it can't run here.": "Elle est activée, mais votre navigateur ne lui a pas donné accès à {sites} : elle ne peut pas fonctionner ici.", + "Your browser declined access to {sites}, so it still can't run here.": "Votre navigateur a refusé l’accès à {sites}, donc elle ne peut toujours pas fonctionner ici.", + "It's on, but it has no access to {sites}, so it can't run here.": "Elle est activée, mais n’a pas accès à {sites}, donc elle ne peut pas fonctionner ici.", "Allow access": "Autoriser l’accès", - "Show a Default Activity": "Afficher une activité par défaut", - "Shared whenever the tab you're on has no Activity: a site none covers, a browser page, a new tab.": "Partagée dès que l’onglet en cours n’a aucune activité : un site qu’aucune ne couvre, une page du navigateur, un nouvel onglet.", + "Turn on the Default Activity": "Activer l’activité par défaut", + "Shared when the tab has no Activity: a site none covers, a browser page, or a new tab.": "Partagée quand l’onglet n’a pas d’activité : un site sans activité, une page du navigateur ou un nouvel onglet.", "Name": "Nom", "Shown as what you're doing, like \"Playing \". Required.": "Affiché comme ce que vous faites, par exemple « Joue à ». Obligatoire.", "Details": "Détails", @@ -26,20 +26,20 @@ "State": "État", "The second line.": "La deuxième ligne.", "Large image": "Grande image", - "An https image link, or an asset name from your own Discord Application.": "Un lien d’image https, ou le nom d’une ressource de votre propre application Discord.", + "An https image link, or an asset name from your Discord application.": "Un lien https vers une image, ou le nom d’un asset de votre application Discord.", "Large image text": "Texte de la grande image", - "Shown when someone hovers over it.": "Affiché au survol.", + "Shown on hover.": "Affiché au survol.", "Small image": "Petite image", "Shown in the large image's corner.": "Affichée dans le coin de la grande image.", "Small image text": "Texte de la petite image", - "Discord Application ID": "Identifiant de l’application Discord", - "Optional: show it as your own Discord Application instead of Parousia.": "Facultatif : l’afficher sous votre propre application Discord plutôt que sous Parousia.", + "Discord application ID": "Identifiant d’application Discord", + "Optional. Show it as your own Discord application instead of Parousia.": "Facultatif. L’afficher comme votre propre application Discord, au lieu de Parousia.", "Button {n}": "Bouton {n}", "Its label.": "Son libellé.", "Button {n} link": "Lien du bouton {n}", "Where it goes.": "Sa destination.", "Show elapsed time": "Afficher le temps écoulé", - "How long it's been shown, counted from when it started.": "Depuis combien de temps elle est affichée, compté à partir du début.", + "Counts up from when it started.": "Compte depuis le début de l’affichage.", "Text": "Texte", "Images": "Images", "Buttons": "Boutons", @@ -48,19 +48,19 @@ "Fix what's marked, then turn it on.": "Corrigez ce qui est signalé, puis activez-la.", "On.": "Activée.", "Off.": "Désactivée.", - "Not saved: fix what's marked.": "Non enregistrée : corrigez ce qui est signalé.", - "Saved. It's shown when no Activity is.": "Enregistrée. Elle s’affiche quand aucune activité n’est détectée.", + "Not saved. Fix the marked fields.": "Non enregistré. Corrigez les champs marqués.", + "Saved. It shows when no Activity has anything to share.": "Enregistré. Elle s’affiche quand aucune activité n’a rien à partager.", "Saved. Turn it on above to share it.": "Enregistrée. Activez-la ci-dessus pour la partager.", "Default Activity": "Activité par défaut", "{first} and {second}": "{first} et {second}", "{first}, {second}, and {n} more": "{first}, {second} et {n} autres", - "Reads only the address and title of its pages, so it needs no site access.": "Ne lit que l’adresse et le titre de ses pages : aucun accès au site n’est nécessaire.", - "Its own code reads its pages. Turning it on asks your browser for access to {sites}.": "Son propre code lit ses pages. L’activer demande à votre navigateur l’accès à {sites}.", - "Parousia reads what's playing on its pages. Turning it on asks your browser for access to {sites}.": "Parousia lit ce qui est en cours de lecture sur ses pages. L’activer demande à votre navigateur l’accès à {sites}.", + "Reads only page addresses and titles, so it needs no site access.": "Ne lit que les adresses et les titres des pages, donc aucun accès aux sites n’est nécessaire.", + "Its code reads the pages it runs on. Turning it on asks your browser for access to {sites}.": "Son code lit les pages sur lesquelles il s’exécute. L’activer demande l’accès à {sites} à votre navigateur.", + "Parousia reads what's playing on those pages. Turning it on asks your browser for access to {sites}.": "Parousia lit ce qui est en cours de lecture sur ces pages. L’activer demande l’accès à {sites} à votre navigateur.", "Show this Activity": "Afficher cette activité", - "It stays off: your browser didn't allow access to {sites}.": "Elle reste désactivée : votre navigateur n’a pas autorisé l’accès à {sites}.", - "Your browser didn't allow access to {sites}, so it still doesn't run there.": "Votre navigateur n’a pas autorisé l’accès à {sites} : elle ne fonctionne toujours pas là-bas.", - "It's on, but can't read {sites}, so it doesn't run there. Access was declined or taken back.": "Elle est activée, mais ne peut pas lire {sites} : elle ne fonctionne donc pas là-bas. L’accès a été refusé ou retiré.", + "It stays off: your browser declined access to {sites}.": "Elle reste désactivée : votre navigateur a refusé l’accès à {sites}.", + "Your browser declined access to {sites}, so it still doesn't run there.": "Votre navigateur a refusé l’accès à {sites}, donc elle ne fonctionne toujours pas là-bas.", + "It's on, but can't read {sites}, so it doesn't run there. Access was declined or revoked.": "Elle est activée, mais ne peut pas lire {sites}, donc elle ne fonctionne pas là-bas. L’accès a été refusé ou retiré.", "PreMiD: {name}": "PreMiD : {name}", "Sites": "Sites", "From": "Origine", @@ -68,24 +68,24 @@ "Activity": "Activité", "Needs access": "Accès requis", "Access declined": "Accès refusé", - "multi": "multi", + "2 sources": "2 sources", "Show {name}": "Afficher {name}", "Filter, {n} selected": "Filtre, {n} sélectionné(s)", "Filter": "Filtre", "Enabled {count}.": "Activées : {count}.", - "Nothing was enabled: your browser didn't grant access to their sites.": "Rien n’a été activé : votre navigateur n’a pas accordé l’accès à leurs sites.", + "Nothing was enabled. Your browser declined access to their sites.": "Rien n’a été activé. Votre navigateur a refusé l’accès à leurs sites.", "Couldn't change the Activities. Try again.": "Impossible de modifier les activités. Réessayez.", "Nothing was on.": "Aucune n’était activée.", "Disabled {count}.": "Désactivées : {count}.", - "No Activities match, so there is nothing to change.": "Aucune activité ne correspond : il n’y a rien à modifier.", - "This applies to the {count} matching your search and filters, on every page.": "Cela s’applique aux {count} correspondant à votre recherche et à vos filtres, sur toutes les pages.", + "No Activities match, so there's nothing to change.": "Aucune activité ne correspond, il n’y a donc rien à modifier.", + "This applies to all {count} matching your search and filters, not only this page.": "Cela s’applique aux {count} activités qui correspondent à votre recherche et à vos filtres, pas seulement à cette page.", "Enable {count}?": "Activer {count} ?", - "None of them needs access to a new site, so your browser won't ask for anything.": "Aucune n’a besoin d’accéder à un nouveau site : votre navigateur ne demandera rien.", + "None needs access to a new site, so your browser won't ask.": "Aucune n’a besoin d’accéder à un nouveau site : votre navigateur ne demandera rien.", "Cancel": "Annuler", "Enable {count}": "Activer {count}", "Disable {count}": "Désactiver {count}", "Disable {count}?": "Désactiver {count} ?", - "Sites only they used are given back to your browser.": "Les sites qu’elles étaient seules à utiliser sont rendus à votre navigateur.", + "Sites only they use are given back to your browser.": "Les sites qu’elles sont seules à utiliser sont rendus à votre navigateur.", "Enable all ({n})": "Tout activer ({n})", "Disable all ({n})": "Tout désactiver ({n})", "{first}–{last} of {total}": "{first}–{last} sur {total}", @@ -100,7 +100,7 @@ "Appearance": "Apparence", "Theme": "Thème", "Privacy": "Confidentialité", - "What's shared, what Activities read, incognito": "Ce qui est partagé, ce que les activités lisent, navigation privée", + "What's shared, what Activities read, private windows": "Ce qui est partagé, ce que lisent les activités, fenêtres privées", "Site access": "Accès aux sites", "Access to all websites": "Accès à tous les sites web", "Platforms": "Plateformes", @@ -112,7 +112,7 @@ "What's playing": "Lecture en cours", "Titles, artists, and progress of what you're watching or listening to.": "Titres, artistes et progression de ce que vous regardez ou écoutez.", "Thumbnails": "Miniatures", - "Images of what you're watching or reading, such as a video's thumbnail or an album cover.": "Images de ce que vous regardez ou lisez, comme la miniature d’une vidéo ou la pochette d’un album.", + "Images of what you're watching or reading, like a video thumbnail or album cover.": "Images de ce que vous regardez ou lisez, comme la miniature d’une vidéo ou une pochette d’album.", "Creator icons": "Icônes des créateurs", "Pictures of the channel, artist, or creator.": "Images de la chaîne, de l’artiste ou du créateur.", "Atelier": "Atelier", @@ -124,42 +124,44 @@ "Automatic": "Automatique", "Connect to Parousia Desktop to see and change these.": "Connectez-vous à Parousia Desktop pour les voir et les modifier.", "Allow userscripts": "Autoriser les scripts utilisateur", - "Any web page can connect while this is on. Userscripts can only publish presence, never read status or change settings.": "Toute page web peut se connecter tant que cette option est activée. Les scripts utilisateur ne peuvent que publier une présence, jamais lire l’état ni modifier les paramètres.", - "Parousia Desktop couldn't confirm this connection is yours, so these can't be changed from here. Use the Parousia-Desktop set command or Desktop's own console instead.": "Parousia Desktop n’a pas pu confirmer que cette connexion est la vôtre : ces réglages ne peuvent donc pas être modifiés ici. Utilisez plutôt la commande Parousia-Desktop set ou la console de Desktop.", + "Any web page can connect while this is on. Userscripts can only send presence, not read status or change settings.": "Tant que c’est activé, n’importe quelle page web peut se connecter. Les userscripts peuvent seulement envoyer une présence, sans lire l’état ni modifier les réglages.", + "Parousia Desktop couldn't confirm this connection is yours, so you can't change these here. Use the Parousia-Desktop set command or Desktop's console instead.": "Parousia Desktop n’a pas pu confirmer que cette connexion est la vôtre : vous ne pouvez donc pas les modifier ici. Utilisez plutôt la commande Parousia-Desktop set ou la console de Desktop.", "Language": "Langue", - "Changing it reloads any open Parousia page.": "Le changer recharge toutes les pages Parousia ouvertes.", + "Open Parousia pages reload when you change it.": "Les pages Parousia ouvertes se rechargent quand vous le changez.", "Parousia Desktop": "Parousia Desktop", - "Share Media Details": "Partager les détails des médias", - "Include what you're watching or reading, not just the site's name.": "Inclure ce que vous regardez ou lisez, et pas seulement le nom du site.", + "Share media details": "Partager les détails des médias", + "Include what you're watching or reading, not only the site's name.": "Inclure ce que vous regardez ou lisez, et pas seulement le nom du site.", + "Show media presence": "Afficher la présence média", + "Keep showing music and video activity when switching to websites without an enabled Activity.": "Continuer à afficher la musique et les vidéos en cours de lecture quand vous passez à un site sans activité activée.", "Shorter": "Plus court", "Longer": "Plus long", "Pause activity": "Suspendre l’activité", "Share as usual": "Partager comme d’habitude", - "Incognito Behaviour": "Comportement en navigation privée", - "What to do in private windows, if you've allowed Parousia there.": "Que faire dans les fenêtres privées, si vous y avez autorisé Parousia.", + "Private windows": "Fenêtres privées", + "What to do in private windows you've allowed Parousia in.": "Ce qu’il faut faire dans les fenêtres privées où vous avez autorisé Parousia.", "What leaves your browser": "Ce qui quitte votre navigateur", - "Idle Timeout": "Délai d’inactivité", - "Keep sharing this long after you switch away from the browser. Sound playing keeps it going.": "Continuer à partager aussi longtemps après avoir quitté le navigateur. Un son en cours de lecture maintient le partage.", + "Idle timeout": "Délai d’inactivité", + "Keep sharing this long after you leave the browser. Sound keeps it going.": "Continuer à partager aussi longtemps après avoir quitté le navigateur. Un son qui joue maintient le partage.", "What Activities may read": "Ce que les activités peuvent lire", - "On sites you've granted, Activities that read pages may take these. Switched off, Parousia doesn't read them, and doesn't show what an Activity's own code read.": "Sur les sites autorisés, les activités qui lisent les pages peuvent en prendre ces éléments. Désactivés, Parousia ne les lit pas et n’affiche pas ce que le code propre à une activité a lu.", + "On sites you've allowed, Activities that read pages may use these. When switched off, Parousia reads none of them and shows no page data from Activities.": "Sur les sites que vous avez autorisés, les activités qui lisent les pages peuvent s’en servir. Désactivé, Parousia n’en lit aucun et n’affiche aucune donnée de page issue des activités.", "{name} Rich Presence": "Rich Presence {name}", - "Show your activity on {name}.": "Afficher votre activité sur {name}.", - "Parousia Desktop shows your activity on these apps. Discord works now. Fluxer doesn't yet let other apps show activity on your profile, and Stoat is still being built, so those choices are saved for when they arrive.": "Parousia Desktop affiche votre activité sur ces applications. Discord fonctionne dès maintenant. Fluxer ne permet pas encore à d’autres applications d’afficher une activité sur votre profil, et Stoat est encore en construction : ces choix sont donc conservés pour leur arrivée.", + "Show your presence on {name}.": "Afficher votre présence sur {name}.", + "Parousia Desktop shows your presence on these apps. Discord works now. Fluxer doesn't let other apps show presence yet, and Stoat is still being built. Choices for them are saved until they arrive.": "Parousia Desktop affiche votre présence dans ces applications. Discord fonctionne déjà. Fluxer ne permet pas encore aux autres applications d’afficher une présence, et Stoat est encore en développement. Vos choix pour ces plateformes sont conservés jusqu’à leur arrivée.", "Discord-RPC-Extension": "Discord-RPC-Extension", - "Show Discord presence through Discord-RPC-Extension's app (discord_rpc_ext) on this computer, when it's running. Rich Presence only: nothing else is sent to it or accepted from it.": "Afficher la présence Discord via l’application de Discord-RPC-Extension (discord_rpc_ext) sur cet ordinateur, lorsqu’elle est lancée. Rich Presence uniquement : rien d’autre ne lui est envoyé ni n’est accepté de sa part.", + "Use Discord-RPC-Extension's app (discord_rpc_ext) on this computer when it's running. Only Rich Presence is sent to it or accepted from it.": "Utilisez l’application Discord-RPC-Extension (discord_rpc_ext) de cet ordinateur lorsqu’elle tourne. Seule la Rich Presence lui est envoyée, et seule la Rich Presence en est acceptée.", "Presence platforms": "Plateformes de présence", "Discord without Parousia Desktop": "Discord sans Parousia Desktop", "Other extensions": "Autres extensions", - "Show what MAL-Sync recognizes on anime and manga sites as your activity there, in place of the site's own. Parousia asks the MAL-Sync extension about the tab you're on and takes only Rich Presence from it. Turn off MAL-Sync's own Discord Rich Presence setting so it isn't shown twice.": "Afficher ce que MAL-Sync reconnaît sur les sites d’anime et de manga comme votre activité, à la place de celle du site. Parousia interroge l’extension MAL-Sync sur l’onglet en cours et n’en reprend que la Rich Presence. Désactivez le réglage Discord Rich Presence propre à MAL-Sync pour éviter un double affichage.", + "Show what MAL-Sync recognizes on anime and manga sites in place of the site's own. Parousia takes only Rich Presence from MAL-Sync. Turn off MAL-Sync's Discord Rich Presence setting so it isn't shown twice.": "Afficher ce que MAL-Sync reconnaît sur les sites d’animes et de mangas, à la place de celui du site. Parousia ne reprend que la Rich Presence de MAL-Sync. Désactivez le réglage Discord Rich Presence de MAL-Sync pour éviter un doublon.", "Parousia Desktop: {status}": "Parousia Desktop : {status}", "Off while Discord Rich Presence is off": "Désactivé tant que Discord Rich Presence l’est", "Standing by while Parousia Desktop shows Discord": "En attente tant que Parousia Desktop affiche Discord", - "Access your data for all websites": "Accéder à vos données sur tous les sites web", - "Off by default. With it on, Activities that read pages can read any site, without asking site by site. Parousia never turns it on by itself.": "Désactivé par défaut. Activé, les activités qui lisent les pages peuvent lire n’importe quel site, sans demander site par site. Parousia ne l’active jamais de lui-même.", + "Allow access to all websites": "Autoriser l’accès à tous les sites", + "Off by default. With it on, Activities that read pages can read any site without asking for each one. Parousia never turns it on by itself.": "Désactivé par défaut. Lorsqu’il est activé, les activités qui lisent les pages peuvent lire n’importe quel site, sans demander pour chacun. Parousia ne l’active jamais d’elle-même.", "All websites": "Tous les sites web", - "Otherwise your browser asks before an Activity reads a site, when you turn the Activity on. Sites you allowed are managed in your browser's settings for this extension.": "Sinon, votre navigateur demande l’autorisation avant qu’une activité lise un site, au moment où vous activez l’activité. Les sites autorisés se gèrent dans les paramètres de votre navigateur pour cette extension.", + "Otherwise, your browser asks before an Activity reads a site, when you turn the Activity on. Manage the sites you've allowed in your browser's settings for this extension.": "Sinon, votre navigateur demande l’autorisation avant qu’une activité lise un site, lorsque vous l’activez. Gérez les sites autorisés dans les paramètres de votre navigateur pour cette extension.", "Change in the dashboard": "Modifier dans le tableau de bord", - "Your browser asks before granting access, which it does from the dashboard.": "Votre navigateur demande avant d’accorder l’accès, ce qu’il fait depuis le tableau de bord.", + "Your browser asks for access from the dashboard.": "Votre navigateur demande l’accès depuis le tableau de bord.", "Coming soon": "Bientôt disponible", "Link accounts such as Jena Cloud to share presence without Parousia Desktop.": "Liez des comptes comme Jena Cloud pour partager votre présence sans Parousia Desktop.", "Extension": "Extension", @@ -187,9 +189,9 @@ "Versions don't match": "Les versions ne correspondent pas", "This extension and Parousia Desktop are different major versions. Update whichever is older.": "Cette extension et Parousia Desktop sont de versions majeures différentes. Mettez à jour la plus ancienne.", "Parousia Desktop couldn't be found": "Parousia Desktop est introuvable", - "Launch Parousia Desktop to share your browser activity.": "Lancez Parousia Desktop pour partager votre activité dans le navigateur.", + "Launch Parousia Desktop to share your presence.": "Lancez Parousia Desktop pour partager votre présence.", "Showing {activity}": "Affiche {activity}", - "Showing your activity": "Affiche votre activité", + "Showing your presence": "Affichage de votre présence", "Ready": "Prêt", "Connecting…": "Connexion…", "Not running": "Non lancé", @@ -197,21 +199,21 @@ "Refused": "Refusé", "Connected, v{version}": "Connecté, v{version}", "Looking for it…": "Recherche en cours…", - "No activity detected": "Aucune activité détectée", - "Browse a supported site and it shows up here.": "Parcourez un site pris en charge et elle apparaîtra ici.", + "No Activity detected": "Aucune activité détectée", + "Visit a supported site and it appears here.": "Visitez un site compatible : il apparaît ici.", "Sharing {name}": "Partage de {name}", "Sharing now": "Partage en cours", "{time} elapsed": "Temps écoulé : {time}", "Update Parousia Desktop": "Mettre à jour Parousia Desktop", "Get Parousia Desktop": "Obtenir Parousia Desktop", "Checking…": "Vérification…", - "Retry Connection": "Réessayer la connexion", - "Discord-RPC-Extension is running, so Discord can still show your activity without Parousia Desktop.": "Discord-RPC-Extension est lancé : Discord peut donc toujours afficher votre activité sans Parousia Desktop.", + "Retry connection": "Réessayer la connexion", + "Discord-RPC-Extension is running, so Discord can still show your presence without Parousia Desktop.": "Discord-RPC-Extension tourne : Discord peut donc encore afficher votre présence sans Parousia Desktop.", "Parousia": "Parousia", "PAROUSIA": "PAROUSIA", "Settings": "Paramètres", - "Current activity": "Activité en cours", - "Configure activity": "Configurer l’activité", + "Now sharing": "Partage en cours", + "Configure Activity": "Configurer l’activité", "PreMiD": "PreMiD", "Preferences": "Préférences", "Changes apply right away.": "Les modifications s’appliquent immédiatement.", @@ -235,17 +237,17 @@ "PreMiD Activities": "Activités PreMiD", "Clear filters": "Effacer les filtres", "Enable or disable all…": "Tout activer ou désactiver…", - "Nothing matches that search and those filters.": "Rien ne correspond à cette recherche et à ces filtres.", + "Nothing matches your search and filters.": "Rien ne correspond à votre recherche et à vos filtres.", "No Activities in this build yet": "Aucune activité dans cette version pour l’instant", - "Until one is added, Parousia recognizes no sites, so nothing about your browsing is shared.": "Tant qu’aucune n’est ajoutée, Parousia ne reconnaît aucun site : rien de votre navigation n’est donc partagé.", + "Until one is added, Parousia recognizes no sites and shares nothing from your browsing.": "Tant qu’aucune n’est ajoutée, Parousia ne reconnaît aucun site et ne partage rien de votre navigation.", "All Activities": "Toutes les activités", "Implementation": "Implémentation", - "Both Parousia and PreMiD have an Activity for this website. Only the one chosen runs.": "Parousia et PreMiD ont chacun une activité pour ce site web. Seule celle qui est choisie s’exécute.", + "Parousia and PreMiD both have an Activity for this website. Only the one you choose runs.": "Parousia et PreMiD ont chacun une activité pour ce site. Seule celle que vous choisissez s’exécute.", "This Activity isn't in this build": "Cette activité n’est pas dans cette version", "It may have been removed, or come from another version of Parousia.": "Elle a peut-être été supprimée, ou vient d’une autre version de Parousia.", - "What to share when the tab you're on has no Activity. Privacy settings and Settings > Platforms apply to it, as to any Activity.": "Ce qu’il faut partager quand l’onglet en cours n’a aucune activité. Les paramètres de confidentialité et Paramètres > Plateformes s’y appliquent, comme à toute activité.", + "What to share when the tab has no Activity. Privacy settings and Settings > Platforms apply to it, as they do to any Activity.": "Ce qu’il faut partager quand l’onglet n’a pas d’activité. Les paramètres de confidentialité et Paramètres > Plateformes s’y appliquent, comme à toute activité.", "Preview": "Aperçu", - "How Parousia behaves in this browser, and Parousia Desktop's own settings.": "Le comportement de Parousia dans ce navigateur, et les réglages propres à Parousia Desktop.", + "How Parousia behaves in this browser, and Parousia Desktop's settings.": "Le comportement de Parousia dans ce navigateur, et les réglages propres à Parousia Desktop.", "Dashboard": "Tableau de bord", "Search Activities or sites": "Rechercher des activités ou des sites", "Filter Activities": "Filtrer les activités", @@ -253,28 +255,28 @@ "Activity pages": "Pages d’activités", "Settings categories": "Catégories de paramètres", "A newer Parousia Desktop is available": "Une version plus récente de Parousia Desktop est disponible", - "This extension is newer than Parousia Desktop {version}. They still work together; update Desktop to get everything the extension offers.": "Cette extension est plus récente que Parousia Desktop {version}. Ils fonctionnent toujours ensemble ; mettez Desktop à jour pour profiter de tout ce que l’extension propose.", + "This extension is newer than Parousia Desktop {version}. They still work together. Update Desktop to get everything the extension offers.": "Cette extension est plus récente que Parousia Desktop {version}. Ils fonctionnent toujours ensemble ; mettez Desktop à jour pour profiter de tout ce que l’extension propose.", "A newer Parousia extension is available": "Une version plus récente de l’extension Parousia est disponible", - "Parousia Desktop {version} is newer than this extension. They still work together; update the extension from your browser's extension page.": "Parousia Desktop {version} est plus récent que cette extension. Ils fonctionnent toujours ensemble ; mettez l’extension à jour depuis la page des extensions de votre navigateur.", + "Parousia Desktop {version} is newer than this extension. They still work together. Update the extension from your browser's extension page.": "Parousia Desktop {version} est plus récent que cette extension. Ils fonctionnent toujours ensemble ; mettez l’extension à jour depuis la page des extensions de votre navigateur.", "Not now": "Pas maintenant", "{n} Activities": { "one": "{n} activité", "many": "{n} d’activités", "other": "{n} activités" }, - "Enabled {count}. {n} Activities stayed off because their sites weren't granted.": { - "one": "Activées : {count}. {n} activité est restée désactivée, car ses sites n’ont pas été autorisés.", - "many": "Activées : {count}. {n} d’activités sont restées désactivées, car leurs sites n’ont pas été autorisés.", - "other": "Activées : {count}. {n} activités sont restées désactivées, car leurs sites n’ont pas été autorisés." + "Enabled {count}. {n} Activities stayed off because access to their sites was declined.": { + "one": "Activées : {count}. {n} activité est restée désactivée, car l’accès à ses sites a été refusé.", + "many": "Activées : {count}. {n} d’activités sont restées désactivées, car l’accès à leurs sites a été refusé.", + "other": "Activées : {count}. {n} activités sont restées désactivées, car l’accès à leurs sites a été refusé." }, "{n} Activities read pages.": { "one": "{n} activité lit des pages.", "many": "{n} d’activités lisent des pages.", "other": "{n} activités lisent des pages." }, - "Your browser will ask for access to {n} sites in one prompt, which can be long. Anything you decline stays off.": { - "one": "Votre navigateur demandera l’accès à {n} site en une seule fois, ce qui peut être long. Tout ce que vous refusez reste désactivé.", - "many": "Votre navigateur demandera l’accès à {n} de sites en une seule fois, ce qui peut être long. Tout ce que vous refusez reste désactivé.", - "other": "Votre navigateur demandera l’accès à {n} sites en une seule fois, ce qui peut être long. Tout ce que vous refusez reste désactivé." + "Your browser asks for access to {n} sites in one prompt. Anything you decline stays off.": { + "one": "Votre navigateur demande l’accès à {n} site en une seule fois. Tout ce que vous refusez reste désactivé.", + "many": "Votre navigateur demande l’accès à {n} de sites en une seule fois. Tout ce que vous refusez reste désactivé.", + "other": "Votre navigateur demande l’accès à {n} sites en une seule fois. Tout ce que vous refusez reste désactivé." } } diff --git a/browser/src/locales/ja.json b/browser/src/locales/ja.json index 11c4547..aedbb36 100644 --- a/browser/src/locales/ja.json +++ b/browser/src/locales/ja.json @@ -2,23 +2,23 @@ "Off": "オフ", "1 h": "1 時間", "{n} min": "{n} 分", - "Give it a name of at least 2 characters.": "2 文字以上の名前を付けてください。", - "Discord leaves out lines under 2 characters.": "Discord は 2 文字未満の行を表示しません。", - "Use an https image link, or an asset name from your own Discord Application.": "https の画像リンク、またはご自身の Discord アプリケーションのアセット名を使ってください。", + "Use a name of at least 2 characters.": "2文字以上の名前を入力してください。", + "Discord drops lines shorter than 2 characters.": "Discordは2文字未満の行を表示しません。", + "Use an https image link, or an asset name from your Discord application.": "https の画像リンク、または Discord アプリケーションのアセット名を入力します。", "A button needs both a label and a link.": "ボタンにはラベルとリンクの両方が必要です。", - "Button links start with https:// or http://.": "ボタンのリンクは https:// または http:// で始めてください。", - "A Discord Application ID is 17 to 20 digits.": "Discord アプリケーション ID は 17〜20 桁の数字です。", - "{name} is on. Nothing to share on this page yet.": "{name} はオンです。このページで共有できるものはまだありません。", - "Nothing to share on this page.": "このページで共有できるものはありません。", - "Your browser didn't allow access to its sites, so it stays off.": "ブラウザーがそのサイトへのアクセスを許可しなかったため、オフのままです。", - "An Activity for this site, turned off. Turning it on asks your browser for access to {sites}.": "このサイト用のアクティビティがありますが、オフになっています。オンにすると、{sites} へのアクセスをブラウザーに求めます。", - "An Activity for this site, turned off.": "このサイト用のアクティビティがありますが、オフになっています。", + "Button links must start with https:// or http://.": "ボタンのリンクは https:// または http:// で始まる必要があります。", + "A Discord application ID is 17 to 20 digits.": "Discord アプリケーション ID は 17~20 桁の数字です。", + "{name} is on. Nothing to share here yet.": "{name} はオンです。ここではまだ共有するものがありません。", + "Nothing to share here.": "ここには共有するものがありません。", + "Your browser declined access to its sites, so it stays off.": "ブラウザーがそのサイトへのアクセスを拒否したため、オフのままです。", + "There's an Activity for this site, and it's off. Turning it on asks your browser for access to {sites}.": "このサイト用のアクティビティがあり、オフになっています。オンにすると、ブラウザーに {sites} へのアクセスを求めます。", + "There's an Activity for this site, and it's off.": "このサイト用のアクティビティがあり、オフになっています。", "Turn on": "オンにする", - "Your browser didn't allow access to {sites}, so it still can't run here.": "ブラウザーが {sites} へのアクセスを許可しなかったため、ここではまだ動作できません。", - "It's on, but your browser hasn't given it access to {sites}, so it can't run here.": "オンになっていますが、ブラウザーが {sites} へのアクセスを許可していないため、ここでは動作できません。", + "Your browser declined access to {sites}, so it still can't run here.": "ブラウザーが {sites} へのアクセスを拒否したため、ここではまだ動作しません。", + "It's on, but it has no access to {sites}, so it can't run here.": "オンになっていますが、{sites} へのアクセス権がないため、ここでは動作しません。", "Allow access": "アクセスを許可", - "Show a Default Activity": "デフォルトのアクティビティを表示", - "Shared whenever the tab you're on has no Activity: a site none covers, a browser page, a new tab.": "表示中のタブにアクティビティがないとき(対応するものがないサイト、ブラウザーのページ、新しいタブ)に共有されます。", + "Turn on the Default Activity": "デフォルトのアクティビティをオンにする", + "Shared when the tab has no Activity: a site none covers, a browser page, or a new tab.": "タブにアクティビティがないときに共有されます。対象外のサイト、ブラウザーのページ、新しいタブが該当します。", "Name": "名前", "Shown as what you're doing, like \"Playing \". Required.": "「<名前> をプレイ中」のように、していることとして表示されます。必須です。", "Details": "詳細", @@ -26,20 +26,20 @@ "State": "状態", "The second line.": "2 行目です。", "Large image": "大きい画像", - "An https image link, or an asset name from your own Discord Application.": "https の画像リンク、またはご自身の Discord アプリケーションのアセット名です。", + "An https image link, or an asset name from your Discord application.": "https の画像リンク、または Discord アプリケーションのアセット名。", "Large image text": "大きい画像のテキスト", - "Shown when someone hovers over it.": "カーソルを合わせると表示されます。", + "Shown on hover.": "ホバー時に表示されます。", "Small image": "小さい画像", "Shown in the large image's corner.": "大きい画像の隅に表示されます。", "Small image text": "小さい画像のテキスト", - "Discord Application ID": "Discord アプリケーション ID", - "Optional: show it as your own Discord Application instead of Parousia.": "任意:Parousia ではなく、ご自身の Discord アプリケーションとして表示します。", + "Discord application ID": "Discord アプリケーション ID", + "Optional. Show it as your own Discord application instead of Parousia.": "任意。Parousia の代わりに、あなた自身の Discord アプリケーションとして表示します。", "Button {n}": "ボタン {n}", "Its label.": "ラベルです。", "Button {n} link": "ボタン {n} のリンク", "Where it goes.": "移動先です。", "Show elapsed time": "経過時間を表示", - "How long it's been shown, counted from when it started.": "開始からの表示時間を数えて表示します。", + "Counts up from when it started.": "表示を開始した時点から数えます。", "Text": "テキスト", "Images": "画像", "Buttons": "ボタン", @@ -48,19 +48,19 @@ "Fix what's marked, then turn it on.": "マークされた箇所を直してから、オンにしてください。", "On.": "オンにしました。", "Off.": "オフにしました。", - "Not saved: fix what's marked.": "保存されていません。マークされた箇所を直してください。", - "Saved. It's shown when no Activity is.": "保存しました。アクティビティがないときに表示されます。", + "Not saved. Fix the marked fields.": "保存されていません。マークされた項目を修正してください。", + "Saved. It shows when no Activity has anything to share.": "保存しました。どのアクティビティも共有するものがないときに表示されます。", "Saved. Turn it on above to share it.": "保存しました。共有するには上でオンにしてください。", "Default Activity": "デフォルトのアクティビティ", "{first} and {second}": "{first} と {second}", "{first}, {second}, and {n} more": "{first}、{second}、ほか {n} 件", - "Reads only the address and title of its pages, so it needs no site access.": "ページのアドレスとタイトルだけを読み取るため、サイトへのアクセスは不要です。", - "Its own code reads its pages. Turning it on asks your browser for access to {sites}.": "独自のコードがページを読み取ります。オンにすると、{sites} へのアクセスをブラウザーに求めます。", - "Parousia reads what's playing on its pages. Turning it on asks your browser for access to {sites}.": "Parousia がそのページで再生中の内容を読み取ります。オンにすると、{sites} へのアクセスをブラウザーに求めます。", + "Reads only page addresses and titles, so it needs no site access.": "ページのアドレスとタイトルだけを読むため、サイトへのアクセスは不要です。", + "Its code reads the pages it runs on. Turning it on asks your browser for access to {sites}.": "そのコードが実行先のページを読み取ります。オンにすると、ブラウザーに {sites} へのアクセスを求めます。", + "Parousia reads what's playing on those pages. Turning it on asks your browser for access to {sites}.": "Parousia はそれらのページで再生中の内容を読み取ります。オンにすると、ブラウザーに {sites} へのアクセスを求めます。", "Show this Activity": "このアクティビティを表示", - "It stays off: your browser didn't allow access to {sites}.": "オフのままです。ブラウザーが {sites} へのアクセスを許可しませんでした。", - "Your browser didn't allow access to {sites}, so it still doesn't run there.": "ブラウザーが {sites} へのアクセスを許可しなかったため、そこではまだ動作しません。", - "It's on, but can't read {sites}, so it doesn't run there. Access was declined or taken back.": "オンになっていますが、{sites} を読み取れないため、そこでは動作しません。アクセスは拒否されたか、取り消されました。", + "It stays off: your browser declined access to {sites}.": "オフのままです。ブラウザーが {sites} へのアクセスを拒否しました。", + "Your browser declined access to {sites}, so it still doesn't run there.": "ブラウザーが {sites} へのアクセスを拒否したため、そこではまだ動作しません。", + "It's on, but can't read {sites}, so it doesn't run there. Access was declined or revoked.": "オンですが {sites} を読み取れないため、そこでは動作しません。アクセスが拒否されたか取り消されました。", "PreMiD: {name}": "PreMiD:{name}", "Sites": "サイト", "From": "提供元", @@ -68,24 +68,24 @@ "Activity": "アクティビティ", "Needs access": "アクセスが必要", "Access declined": "アクセス拒否", - "multi": "複数", + "2 sources": "2つのソース", "Show {name}": "{name} を表示", "Filter, {n} selected": "フィルター({n} 件選択中)", "Filter": "フィルター", "Enabled {count}.": "{count}を有効にしました。", - "Nothing was enabled: your browser didn't grant access to their sites.": "有効にしたものはありません。ブラウザーがそれらのサイトへのアクセスを許可しませんでした。", + "Nothing was enabled. Your browser declined access to their sites.": "何も有効になりませんでした。ブラウザーがそれらのサイトへのアクセスを拒否しました。", "Couldn't change the Activities. Try again.": "アクティビティを変更できませんでした。もう一度お試しください。", "Nothing was on.": "オンのものはありませんでした。", "Disabled {count}.": "{count}を無効にしました。", - "No Activities match, so there is nothing to change.": "一致するアクティビティがないため、変更するものはありません。", - "This applies to the {count} matching your search and filters, on every page.": "検索とフィルターに一致する{count}に、すべてのページで適用されます。", + "No Activities match, so there's nothing to change.": "一致するアクティビティがないため、変更するものはありません。", + "This applies to all {count} matching your search and filters, not only this page.": "検索とフィルターに一致する {count} 件すべてに適用されます。このページだけではありません。", "Enable {count}?": "{count}を有効にしますか?", - "None of them needs access to a new site, so your browser won't ask for anything.": "新しいサイトへのアクセスが必要なものはないため、ブラウザーから確認されることはありません。", + "None needs access to a new site, so your browser won't ask.": "新しいサイトへのアクセスが必要なものはないため、ブラウザーは確認しません。", "Cancel": "キャンセル", "Enable {count}": "{count}を有効にする", "Disable {count}": "{count}を無効にする", "Disable {count}?": "{count}を無効にしますか?", - "Sites only they used are given back to your browser.": "それらだけが使っていたサイトのアクセスは、ブラウザーに返されます。", + "Sites only they use are given back to your browser.": "それらだけが使っているサイトのアクセスは、ブラウザーに返されます。", "Enable all ({n})": "すべて有効にする({n})", "Disable all ({n})": "すべて無効にする({n})", "{first}–{last} of {total}": "{total} 件中 {first}–{last} 件", @@ -100,7 +100,7 @@ "Appearance": "外観", "Theme": "テーマ", "Privacy": "プライバシー", - "What's shared, what Activities read, incognito": "共有する内容、アクティビティが読み取る内容、プライベートウィンドウ", + "What's shared, what Activities read, private windows": "共有される内容、アクティビティが読み取る内容、プライベートウィンドウ", "Site access": "サイトへのアクセス", "Access to all websites": "すべてのウェブサイトへのアクセス", "Platforms": "プラットフォーム", @@ -112,7 +112,7 @@ "What's playing": "再生中の内容", "Titles, artists, and progress of what you're watching or listening to.": "視聴中・再生中の内容のタイトル、アーティスト、進行状況です。", "Thumbnails": "サムネイル", - "Images of what you're watching or reading, such as a video's thumbnail or an album cover.": "動画のサムネイルやアルバムのジャケットなど、視聴中・閲覧中の内容の画像です。", + "Images of what you're watching or reading, like a video thumbnail or album cover.": "視聴中・閲覧中のコンテンツの画像です。動画のサムネイルやアルバムのジャケットなど。", "Creator icons": "クリエイターのアイコン", "Pictures of the channel, artist, or creator.": "チャンネル、アーティスト、クリエイターの画像です。", "Atelier": "Atelier", @@ -124,42 +124,44 @@ "Automatic": "自動", "Connect to Parousia Desktop to see and change these.": "これらの確認と変更には、Parousia Desktop に接続してください。", "Allow userscripts": "ユーザースクリプトを許可", - "Any web page can connect while this is on. Userscripts can only publish presence, never read status or change settings.": "オンの間は、どのウェブページでも接続できます。ユーザースクリプトにできるのはプレゼンスの公開だけで、状態の読み取りや設定の変更はできません。", - "Parousia Desktop couldn't confirm this connection is yours, so these can't be changed from here. Use the Parousia-Desktop set command or Desktop's own console instead.": "Parousia Desktop がこの接続があなたのものだと確認できなかったため、ここからは変更できません。代わりに Parousia-Desktop set コマンドか Desktop のコンソールを使ってください。", + "Any web page can connect while this is on. Userscripts can only send presence, not read status or change settings.": "オンの間は、どの Web ページでも接続できます。ユーザースクリプトはプレゼンスの送信のみ可能で、状態の読み取りや設定の変更はできません。", + "Parousia Desktop couldn't confirm this connection is yours, so you can't change these here. Use the Parousia-Desktop set command or Desktop's console instead.": "Parousia Desktop はこの接続があなたのものであることを確認できなかったため、ここでは変更できません。代わりに Parousia-Desktop の set コマンドか Desktop のコンソールを使ってください。", "Language": "言語", - "Changing it reloads any open Parousia page.": "変更すると、開いているすべての Parousia のページが再読み込みされます。", + "Open Parousia pages reload when you change it.": "変更すると、開いている Parousia のページが再読み込みされます。", "Parousia Desktop": "Parousia Desktop", - "Share Media Details": "メディアの詳細を共有", - "Include what you're watching or reading, not just the site's name.": "サイト名だけでなく、視聴中・閲覧中の内容も含めます。", + "Share media details": "メディアの詳細を共有", + "Include what you're watching or reading, not only the site's name.": "サイト名だけでなく、視聴中・閲覧中の内容も含めます。", + "Show media presence": "メディアのプレゼンスを表示", + "Keep showing music and video activity when switching to websites without an enabled Activity.": "有効なアクティビティがないウェブサイトに移動しても、音楽や動画のアクティビティを表示し続けます。", "Shorter": "短くする", "Longer": "長くする", "Pause activity": "アクティビティを一時停止", "Share as usual": "通常どおり共有", - "Incognito Behaviour": "プライベートウィンドウでの動作", - "What to do in private windows, if you've allowed Parousia there.": "Parousia を許可している場合の、プライベートウィンドウでの動作です。", + "Private windows": "プライベートウィンドウ", + "What to do in private windows you've allowed Parousia in.": "Parousia の使用を許可したプライベートウィンドウでの動作です。", "What leaves your browser": "ブラウザーの外に出る情報", - "Idle Timeout": "アイドルタイムアウト", - "Keep sharing this long after you switch away from the browser. Sound playing keeps it going.": "ブラウザーから離れたあと、この時間だけ共有を続けます。音が再生されている間は続きます。", + "Idle timeout": "アイドルタイムアウト", + "Keep sharing this long after you leave the browser. Sound keeps it going.": "ブラウザーを離れたあと、この時間だけ共有を続けます。音が鳴っている間は続きます。", "What Activities may read": "アクティビティが読み取れる内容", - "On sites you've granted, Activities that read pages may take these. Switched off, Parousia doesn't read them, and doesn't show what an Activity's own code read.": "許可したサイトでは、ページを読み取るアクティビティがこれらを取得することがあります。オフにすると、Parousia はこれらを読み取らず、アクティビティ独自のコードが読み取った内容も表示しません。", + "On sites you've allowed, Activities that read pages may use these. When switched off, Parousia reads none of them and shows no page data from Activities.": "許可したサイトでは、ページを読み取るアクティビティがこれらを使えます。オフの場合、Parousia はいずれも読み取らず、アクティビティからのページデータも表示しません。", "{name} Rich Presence": "{name} のリッチプレゼンス", - "Show your activity on {name}.": "{name} にアクティビティを表示します。", - "Parousia Desktop shows your activity on these apps. Discord works now. Fluxer doesn't yet let other apps show activity on your profile, and Stoat is still being built, so those choices are saved for when they arrive.": "Parousia Desktop がこれらのアプリにアクティビティを表示します。Discord はすでに利用できます。Fluxer はまだ他のアプリがプロフィールにアクティビティを表示することを許可しておらず、Stoat は開発中のため、これらの選択は対応する時のために保存されます。", + "Show your presence on {name}.": "{name} にプレゼンスを表示します。", + "Parousia Desktop shows your presence on these apps. Discord works now. Fluxer doesn't let other apps show presence yet, and Stoat is still being built. Choices for them are saved until they arrive.": "Parousia Desktop は、これらのアプリでプレゼンスを表示します。Discord はすでに対応しています。Fluxer はまだ他のアプリからのプレゼンス表示に対応しておらず、Stoat は開発中です。これらの設定は、対応するまで保存されます。", "Discord-RPC-Extension": "Discord-RPC-Extension", - "Show Discord presence through Discord-RPC-Extension's app (discord_rpc_ext) on this computer, when it's running. Rich Presence only: nothing else is sent to it or accepted from it.": "このコンピューターで Discord-RPC-Extension のアプリ(discord_rpc_ext)が動作しているとき、それを通じて Discord のプレゼンスを表示します。対象はリッチプレゼンスのみで、それ以外は送信も受信もしません。", + "Use Discord-RPC-Extension's app (discord_rpc_ext) on this computer when it's running. Only Rich Presence is sent to it or accepted from it.": "このコンピューターで実行中の Discord-RPC-Extension のアプリ(discord_rpc_ext)を使います。送受信されるのは Rich Presence のみです。", "Presence platforms": "プレゼンスのプラットフォーム", "Discord without Parousia Desktop": "Parousia Desktop なしの Discord", "Other extensions": "他の拡張機能", - "Show what MAL-Sync recognizes on anime and manga sites as your activity there, in place of the site's own. Parousia asks the MAL-Sync extension about the tab you're on and takes only Rich Presence from it. Turn off MAL-Sync's own Discord Rich Presence setting so it isn't shown twice.": "アニメやマンガのサイトで MAL-Sync が認識した内容を、そのサイト自身のアクティビティの代わりにあなたのアクティビティとして表示します。Parousia は現在のタブについて MAL-Sync 拡張機能に問い合わせ、Rich Presence のみを受け取ります。二重に表示されないよう、MAL-Sync 自身の Discord Rich Presence 設定はオフにしてください。", + "Show what MAL-Sync recognizes on anime and manga sites in place of the site's own. Parousia takes only Rich Presence from MAL-Sync. Turn off MAL-Sync's Discord Rich Presence setting so it isn't shown twice.": "アニメと漫画のサイトで MAL-Sync が認識した内容を、サイト自身の表示の代わりに表示します。Parousia は MAL-Sync から Rich Presence だけを取得します。二重表示を防ぐため、MAL-Sync の Discord Rich Presence 設定をオフにしてください。", "Parousia Desktop: {status}": "Parousia Desktop:{status}", "Off while Discord Rich Presence is off": "Discord リッチプレゼンスがオフの間はオフです", "Standing by while Parousia Desktop shows Discord": "Parousia Desktop が Discord に表示している間は待機中です", - "Access your data for all websites": "すべてのウェブサイトのデータへのアクセス", - "Off by default. With it on, Activities that read pages can read any site, without asking site by site. Parousia never turns it on by itself.": "デフォルトではオフです。オンにすると、ページを読み取るアクティビティが、サイトごとの確認なしにあらゆるサイトを読み取れます。Parousia が自動でオンにすることはありません。", + "Allow access to all websites": "すべてのウェブサイトへのアクセスを許可", + "Off by default. With it on, Activities that read pages can read any site without asking for each one. Parousia never turns it on by itself.": "初期値はオフです。オンにすると、ページを読み取るアクティビティはサイトごとに確認せず、どのサイトも読み取れます。Parousia が自動でオンにすることはありません。", "All websites": "すべてのウェブサイト", - "Otherwise your browser asks before an Activity reads a site, when you turn the Activity on. Sites you allowed are managed in your browser's settings for this extension.": "オフの場合は、アクティビティをオンにしたときに、サイトを読み取る前にブラウザーが確認します。許可したサイトは、ブラウザーのこの拡張機能の設定で管理できます。", + "Otherwise, your browser asks before an Activity reads a site, when you turn the Activity on. Manage the sites you've allowed in your browser's settings for this extension.": "それ以外の場合は、アクティビティをオンにしたときに、アクティビティがサイトを読み取る前にブラウザーが確認します。許可したサイトは、この拡張機能のブラウザー設定で管理できます。", "Change in the dashboard": "ダッシュボードで変更", - "Your browser asks before granting access, which it does from the dashboard.": "ブラウザーはアクセスを許可する前に確認します。その確認はダッシュボードから行われます。", + "Your browser asks for access from the dashboard.": "アクセスの確認は、ブラウザーがダッシュボードから行います。", "Coming soon": "近日公開", "Link accounts such as Jena Cloud to share presence without Parousia Desktop.": "Jena Cloud などのアカウントを連携すると、Parousia Desktop なしでプレゼンスを共有できます。", "Extension": "拡張機能", @@ -187,9 +189,9 @@ "Versions don't match": "バージョンが一致しません", "This extension and Parousia Desktop are different major versions. Update whichever is older.": "この拡張機能と Parousia Desktop はメジャーバージョンが異なります。古いほうを更新してください。", "Parousia Desktop couldn't be found": "Parousia Desktop が見つかりません", - "Launch Parousia Desktop to share your browser activity.": "ブラウザーのアクティビティを共有するには、Parousia Desktop を起動してください。", + "Launch Parousia Desktop to share your presence.": "Parousia Desktop を起動すると、プレゼンスを共有できます。", "Showing {activity}": "{activity} を表示中", - "Showing your activity": "アクティビティを表示中", + "Showing your presence": "プレゼンスを表示中", "Ready": "準備完了", "Connecting…": "接続中…", "Not running": "未起動", @@ -197,21 +199,21 @@ "Refused": "拒否", "Connected, v{version}": "接続済み(v{version})", "Looking for it…": "探しています…", - "No activity detected": "アクティビティが検出されていません", - "Browse a supported site and it shows up here.": "対応サイトを閲覧すると、ここに表示されます。", + "No Activity detected": "アクティビティは検出されていません", + "Visit a supported site and it appears here.": "対応サイトを開くと、ここに表示されます。", "Sharing {name}": "{name} を共有中", "Sharing now": "共有中", "{time} elapsed": "経過時間 {time}", "Update Parousia Desktop": "Parousia Desktop を更新", "Get Parousia Desktop": "Parousia Desktop を入手", "Checking…": "確認中…", - "Retry Connection": "接続を再試行", - "Discord-RPC-Extension is running, so Discord can still show your activity without Parousia Desktop.": "Discord-RPC-Extension が動作しているため、Parousia Desktop がなくても Discord にアクティビティを表示できます。", + "Retry connection": "接続を再試行", + "Discord-RPC-Extension is running, so Discord can still show your presence without Parousia Desktop.": "Discord-RPC-Extension が動作中のため、Parousia Desktop がなくても Discord にプレゼンスを表示できます。", "Parousia": "Parousia", "PAROUSIA": "PAROUSIA", "Settings": "設定", - "Current activity": "現在のアクティビティ", - "Configure activity": "アクティビティを設定", + "Now sharing": "共有中", + "Configure Activity": "アクティビティを設定", "PreMiD": "PreMiD", "Preferences": "環境設定", "Changes apply right away.": "変更はすぐに反映されます。", @@ -235,17 +237,17 @@ "PreMiD Activities": "PreMiD のアクティビティ", "Clear filters": "フィルターをクリア", "Enable or disable all…": "すべて有効/無効にする…", - "Nothing matches that search and those filters.": "その検索とフィルターに一致するものはありません。", + "Nothing matches your search and filters.": "検索条件とフィルターに一致するものはありません。", "No Activities in this build yet": "このビルドにはまだアクティビティがありません", - "Until one is added, Parousia recognizes no sites, so nothing about your browsing is shared.": "追加されるまで、Parousia はどのサイトも認識しないため、閲覧に関する情報は共有されません。", + "Until one is added, Parousia recognizes no sites and shares nothing from your browsing.": "追加されるまで、Parousia はどのサイトも認識せず、ブラウズ内容を何も共有しません。", "All Activities": "すべてのアクティビティ", "Implementation": "実装", - "Both Parousia and PreMiD have an Activity for this website. Only the one chosen runs.": "このウェブサイトには、Parousia と PreMiD の両方にアクティビティがあります。選択したものだけが動作します。", + "Parousia and PreMiD both have an Activity for this website. Only the one you choose runs.": "この Web サイトには Parousia と PreMiD の両方にアクティビティがあります。選んだものだけが動作します。", "This Activity isn't in this build": "このアクティビティはこのビルドにありません", "It may have been removed, or come from another version of Parousia.": "削除されたか、別のバージョンの Parousia のものかもしれません。", - "What to share when the tab you're on has no Activity. Privacy settings and Settings > Platforms apply to it, as to any Activity.": "表示中のタブにアクティビティがないときに共有する内容です。ほかのアクティビティと同様に、プライバシー設定と[設定]>[プラットフォーム]が適用されます。", + "What to share when the tab has no Activity. Privacy settings and Settings > Platforms apply to it, as they do to any Activity.": "タブにアクティビティがないときに共有する内容です。プライバシー設定と[設定]>[プラットフォーム]は、ほかのアクティビティと同様にこれにも適用されます。", "Preview": "プレビュー", - "How Parousia behaves in this browser, and Parousia Desktop's own settings.": "このブラウザーでの Parousia の動作と、Parousia Desktop 自体の設定です。", + "How Parousia behaves in this browser, and Parousia Desktop's settings.": "このブラウザーでの Parousia の動作と、Parousia Desktop 自体の設定です。", "Dashboard": "ダッシュボード", "Search Activities or sites": "アクティビティまたはサイトを検索", "Filter Activities": "アクティビティをフィルター", @@ -253,12 +255,12 @@ "Activity pages": "アクティビティのページ", "Settings categories": "設定のカテゴリー", "{n} Activities": "{n} 件のアクティビティ", - "Enabled {count}. {n} Activities stayed off because their sites weren't granted.": "{count}を有効にしました。{n} 件は、サイトが許可されなかったためオフのままです。", + "Enabled {count}. {n} Activities stayed off because access to their sites was declined.": "{count}を有効にしました。{n} 件は、サイトへのアクセスが拒否されたためオフのままです。", "{n} Activities read pages.": "{n} 件のアクティビティがページを読み取ります。", - "Your browser will ask for access to {n} sites in one prompt, which can be long. Anything you decline stays off.": "ブラウザーが {n} 件のサイトへのアクセスを一度にまとめて確認します。長くなることがあります。許可しなかったものはオフのままです。", + "Your browser asks for access to {n} sites in one prompt. Anything you decline stays off.": "ブラウザーは {n} 件のサイトへのアクセスを一度にまとめて確認します。許可しなかったものはオフのままです。", "A newer Parousia Desktop is available": "Parousia Desktop の新しいバージョンがあります", - "This extension is newer than Parousia Desktop {version}. They still work together; update Desktop to get everything the extension offers.": "この拡張機能は Parousia Desktop {version} より新しいバージョンです。引き続き連携しますが、拡張機能のすべての機能を使うには Desktop を更新してください。", + "This extension is newer than Parousia Desktop {version}. They still work together. Update Desktop to get everything the extension offers.": "この拡張機能は Parousia Desktop {version} より新しいバージョンです。引き続き連携しますが、拡張機能のすべての機能を使うには Desktop を更新してください。", "A newer Parousia extension is available": "Parousia 拡張機能の新しいバージョンがあります", - "Parousia Desktop {version} is newer than this extension. They still work together; update the extension from your browser's extension page.": "Parousia Desktop {version} はこの拡張機能より新しいバージョンです。引き続き連携しますが、ブラウザーの拡張機能ページから拡張機能を更新してください。", + "Parousia Desktop {version} is newer than this extension. They still work together. Update the extension from your browser's extension page.": "Parousia Desktop {version} はこの拡張機能より新しいバージョンです。引き続き連携しますが、ブラウザーの拡張機能ページから拡張機能を更新してください。", "Not now": "今はしない" } diff --git a/browser/src/locales/ro.json b/browser/src/locales/ro.json index f8d053a..1befb68 100644 --- a/browser/src/locales/ro.json +++ b/browser/src/locales/ro.json @@ -2,23 +2,23 @@ "Off": "Oprit", "1 h": "1 h", "{n} min": "{n} min", - "Give it a name of at least 2 characters.": "Introduceți un nume de cel puțin 2 caractere.", - "Discord leaves out lines under 2 characters.": "Discord omite rândurile mai scurte de 2 caractere.", - "Use an https image link, or an asset name from your own Discord Application.": "Utilizați un link de imagine https sau numele unei resurse din propria aplicație Discord.", + "Use a name of at least 2 characters.": "Folosiți un nume de cel puțin 2 caractere.", + "Discord drops lines shorter than 2 characters.": "Discord omite rândurile cu mai puțin de 2 caractere.", + "Use an https image link, or an asset name from your Discord application.": "Folosiți un link https către o imagine sau numele unui asset din aplicația dvs. Discord.", "A button needs both a label and a link.": "Un buton are nevoie atât de o etichetă, cât și de un link.", - "Button links start with https:// or http://.": "Linkurile butoanelor trebuie să înceapă cu https:// sau http://.", - "A Discord Application ID is 17 to 20 digits.": "ID-ul unei aplicații Discord are între 17 și 20 de cifre.", - "{name} is on. Nothing to share on this page yet.": "{name} este activat. Nimic de distribuit pe această pagină deocamdată.", - "Nothing to share on this page.": "Nimic de distribuit pe această pagină.", - "Your browser didn't allow access to its sites, so it stays off.": "Browserul dvs. nu a permis accesul la site-urile sale, așa că rămâne dezactivat.", - "An Activity for this site, turned off. Turning it on asks your browser for access to {sites}.": "O activitate pentru acest site este dezactivată. Activarea ei va solicita browserului dvs. acces la {sites}.", - "An Activity for this site, turned off.": "O activitate pentru acest site este dezactivată.", + "Button links must start with https:// or http://.": "Linkurile butoanelor trebuie să înceapă cu https:// sau http://.", + "A Discord application ID is 17 to 20 digits.": "ID-ul aplicației Discord are între 17 și 20 de cifre.", + "{name} is on. Nothing to share here yet.": "{name} este activată. Încă nu există nimic de distribuit aici.", + "Nothing to share here.": "Nu există nimic de distribuit aici.", + "Your browser declined access to its sites, so it stays off.": "Browserul a refuzat accesul la site-urile sale, așa că rămâne oprită.", + "There's an Activity for this site, and it's off. Turning it on asks your browser for access to {sites}.": "Există o activitate pentru acest site, și este oprită. Pornirea ei cere browserului acces la {sites}.", + "There's an Activity for this site, and it's off.": "Există o activitate pentru acest site, și este oprită.", "Turn on": "Activează", - "Your browser didn't allow access to {sites}, so it still can't run here.": "Browserul dvs. nu a permis accesul la {sites}, așa că tot nu poate rula aici.", - "It's on, but your browser hasn't given it access to {sites}, so it can't run here.": "Este activat, dar browserul dvs. nu i-a oferit acces la {sites}, așa că nu poate rula aici.", + "Your browser declined access to {sites}, so it still can't run here.": "Browserul a refuzat accesul la {sites}, așa că nu poate rula încă aici.", + "It's on, but it has no access to {sites}, so it can't run here.": "Este activată, dar nu are acces la {sites}, așa că nu poate rula aici.", "Allow access": "Permite accesul", - "Show a Default Activity": "Afișează o activitate implicită", - "Shared whenever the tab you're on has no Activity: a site none covers, a browser page, a new tab.": "Distribuit de fiecare dată când fila pe care vă aflați nu are nicio activitate: un site pe care nu îl acoperă nicio activitate, o pagină de browser, o filă nouă.", + "Turn on the Default Activity": "Activează activitatea implicită", + "Shared when the tab has no Activity: a site none covers, a browser page, or a new tab.": "Se distribuie când fila nu are nicio activitate: un site fără activitate, o pagină a browserului sau un tab nou.", "Name": "Nume", "Shown as what you're doing, like \"Playing \". Required.": "Afișat ca fiind ceea ce faceți, de exemplu „Se joacă ”. Obligatoriu.", "Details": "Detalii", @@ -26,20 +26,20 @@ "State": "Stare", "The second line.": "Al doilea rând.", "Large image": "Imagine mare", - "An https image link, or an asset name from your own Discord Application.": "Un link de imagine https sau numele unei resurse din propria aplicație Discord.", + "An https image link, or an asset name from your Discord application.": "Un link https către o imagine sau numele unui asset din aplicația dvs. Discord.", "Large image text": "Text pentru imaginea mare", - "Shown when someone hovers over it.": "Afișat când cineva trece cu cursorul peste ea.", + "Shown on hover.": "Apare la trecerea cursorului.", "Small image": "Imagine mică", "Shown in the large image's corner.": "Afișată în colțul imaginii mari.", "Small image text": "Text pentru imaginea mică", - "Discord Application ID": "ID aplicație Discord", - "Optional: show it as your own Discord Application instead of Parousia.": "Opțional: afișați-o ca fiind propria aplicație Discord în loc de Parousia.", + "Discord application ID": "ID-ul aplicației Discord", + "Optional. Show it as your own Discord application instead of Parousia.": "Opțional. Afișați-l ca aplicația dvs. Discord, în loc de Parousia.", "Button {n}": "Butonul {n}", "Its label.": "Eticheta sa.", "Button {n} link": "Linkul butonului {n}", "Where it goes.": "Unde duce.", "Show elapsed time": "Afișează timpul scurs", - "How long it's been shown, counted from when it started.": "De cât timp este afișată, numărat de când a început.", + "Counts up from when it started.": "Numără de la momentul în care a început să apară.", "Text": "Text", "Images": "Imagini", "Buttons": "Butoane", @@ -48,19 +48,19 @@ "Fix what's marked, then turn it on.": "Corectați ce este marcat, apoi activați-o.", "On.": "Pornit.", "Off.": "Oprit.", - "Not saved: fix what's marked.": "Nesalvat: corectați ce este marcat.", - "Saved. It's shown when no Activity is.": "Salvat. Se afișează când nu este nicio activitate detectată.", + "Not saved. Fix the marked fields.": "Nesalvat. Corectați câmpurile marcate.", + "Saved. It shows when no Activity has anything to share.": "Salvat. Apare când nicio activitate nu are ce distribui.", "Saved. Turn it on above to share it.": "Salvat. Activați-o mai sus pentru a o distribui.", "Default Activity": "Activitate implicită", "{first} and {second}": "{first} și {second}", "{first}, {second}, and {n} more": "{first}, {second} și încă {n}", - "Reads only the address and title of its pages, so it needs no site access.": "Citește doar adresa și titlul paginilor sale, deci nu are nevoie de acces la site.", - "Its own code reads its pages. Turning it on asks your browser for access to {sites}.": "Codul propriu îi citește paginile. Activarea ei va solicita browserului dvs. acces la {sites}.", - "Parousia reads what's playing on its pages. Turning it on asks your browser for access to {sites}.": "Parousia citește ce se redă pe paginile sale. Activarea ei va solicita browserului dvs. acces la {sites}.", + "Reads only page addresses and titles, so it needs no site access.": "Citește doar adresele și titlurile paginilor, deci nu are nevoie de acces la site-uri.", + "Its code reads the pages it runs on. Turning it on asks your browser for access to {sites}.": "Codul ei citește paginile pe care rulează. Pornirea cere browserului acces la {sites}.", + "Parousia reads what's playing on those pages. Turning it on asks your browser for access to {sites}.": "Parousia citește ce se redă pe aceste pagini. Pornirea cere browserului acces la {sites}.", "Show this Activity": "Afișează această activitate", - "It stays off: your browser didn't allow access to {sites}.": "Rămâne dezactivată: browserul dvs. nu a permis accesul la {sites}.", - "Your browser didn't allow access to {sites}, so it still doesn't run there.": "Browserul dvs. nu a permis accesul la {sites}, așa că tot nu rulează acolo.", - "It's on, but can't read {sites}, so it doesn't run there. Access was declined or taken back.": "Este activată, dar nu poate citi {sites}, așa că nu rulează acolo. Accesul a fost refuzat sau retras.", + "It stays off: your browser declined access to {sites}.": "Rămâne oprită: browserul a refuzat accesul la {sites}.", + "Your browser declined access to {sites}, so it still doesn't run there.": "Browserul a refuzat accesul la {sites}, așa că nu rulează încă acolo.", + "It's on, but can't read {sites}, so it doesn't run there. Access was declined or revoked.": "Este activată, dar nu poate citi {sites}, așa că nu rulează acolo. Accesul a fost refuzat sau retras.", "PreMiD: {name}": "PreMiD: {name}", "Sites": "Site-uri", "From": "Sursă", @@ -68,24 +68,24 @@ "Activity": "Activitate", "Needs access": "Necesită acces", "Access declined": "Acces refuzat", - "multi": "multi", + "2 sources": "2 surse", "Show {name}": "Afișează {name}", "Filter, {n} selected": "Filtru, {n} selectat(e)", "Filter": "Filtru", "Enabled {count}.": "Activate: {count}.", - "Nothing was enabled: your browser didn't grant access to their sites.": "Nimic nu a fost activat: browserul dvs. nu a acordat acces la site-urile lor.", + "Nothing was enabled. Your browser declined access to their sites.": "Nimic nu a fost activat. Browserul a refuzat accesul la site-urile lor.", "Couldn't change the Activities. Try again.": "Nu s-au putut modifica activitățile. Încercați din nou.", "Nothing was on.": "Nimic nu era activat.", "Disabled {count}.": "Dezactivate: {count}.", - "No Activities match, so there is nothing to change.": "Nicio activitate nu se potrivește, așa că nu este nimic de modificat.", - "This applies to the {count} matching your search and filters, on every page.": "Acest lucru se aplică celor {count} care se potrivesc cu căutarea și filtrele dvs., pe fiecare pagină.", + "No Activities match, so there's nothing to change.": "Nicio activitate nu se potrivește, deci nu există nimic de schimbat.", + "This applies to all {count} matching your search and filters, not only this page.": "Se aplică tuturor celor {count} care se potrivesc cu căutarea și filtrele, nu doar paginii curente.", "Enable {count}?": "Activați {count}?", - "None of them needs access to a new site, so your browser won't ask for anything.": "Niciuna dintre ele nu are nevoie de acces la un site nou, așa că browserul nu vă va cere nimic.", + "None needs access to a new site, so your browser won't ask.": "Niciuna nu are nevoie de acces la un site nou, deci browserul nu va cere nimic.", "Cancel": "Anulează", "Enable {count}": "Activează {count}", "Disable {count}": "Dezactivează {count}", "Disable {count}?": "Dezactivați {count}?", - "Sites only they used are given back to your browser.": "Site-urile pe care le foloseau doar ele sunt eliberate browserului dvs.", + "Sites only they use are given back to your browser.": "Site-urile pe care le folosesc doar ele sunt eliberate browserului dvs.", "Enable all ({n})": "Activează tot ({n})", "Disable all ({n})": "Dezactivează tot ({n})", "{first}–{last} of {total}": "{first}–{last} din {total}", @@ -100,7 +100,7 @@ "Appearance": "Aspect", "Theme": "Temă", "Privacy": "Confidențialitate", - "What's shared, what Activities read, incognito": "Ce se distribuie, ce citesc activitățile, incognito", + "What's shared, what Activities read, private windows": "Ce se distribuie, ce citesc activitățile, ferestre private", "Site access": "Acces site-uri", "Access to all websites": "Acces la toate site-urile web", "Platforms": "Platforme", @@ -112,7 +112,7 @@ "What's playing": "Se redă acum", "Titles, artists, and progress of what you're watching or listening to.": "Titlurile, artiștii și progresul a ceea ce vizionați sau ascultați.", "Thumbnails": "Miniaturi", - "Images of what you're watching or reading, such as a video's thumbnail or an album cover.": "Imagini cu ceea ce vizionați sau citiți, cum ar fi miniatura unui videoclip sau coperta unui album.", + "Images of what you're watching or reading, like a video thumbnail or album cover.": "Imagini cu ce vizionați sau citiți, cum ar fi miniatura unui videoclip sau coperta unui album.", "Creator icons": "Pictograme creatori", "Pictures of the channel, artist, or creator.": "Imagini ale canalului, artistului sau creatorului.", "Atelier": "Atelier", @@ -124,42 +124,44 @@ "Automatic": "Automat", "Connect to Parousia Desktop to see and change these.": "Conectați-vă la Parousia Desktop pentru a le vedea și modifica.", "Allow userscripts": "Permite scripturile de utilizator", - "Any web page can connect while this is on. Userscripts can only publish presence, never read status or change settings.": "Orice pagină web se poate conecta cât timp această opțiune este activată. Scripturile de utilizator pot doar să publice prezența, fără a citi starea sau a modifica setările.", - "Parousia Desktop couldn't confirm this connection is yours, so these can't be changed from here. Use the Parousia-Desktop set command or Desktop's own console instead.": "Parousia Desktop nu a putut confirma că această conexiune vă aparține, așa că aceste setări nu pot fi modificate de aici. Utilizați în schimb comanda Parousia-Desktop set sau consola proprie Parousia Desktop.", + "Any web page can connect while this is on. Userscripts can only send presence, not read status or change settings.": "Cât timp este pornit, orice pagină web se poate conecta. Userscripturile pot trimite doar prezență, fără să citească starea sau să modifice setările.", + "Parousia Desktop couldn't confirm this connection is yours, so you can't change these here. Use the Parousia-Desktop set command or Desktop's console instead.": "Parousia Desktop nu a putut confirma că această conexiune este a dvs., deci nu puteți modifica aceste setări de aici. Folosiți comanda Parousia-Desktop set sau consola Desktop.", "Language": "Limbă", - "Changing it reloads any open Parousia page.": "Schimbarea acesteia reîncarcă orice pagină Parousia deschisă.", + "Open Parousia pages reload when you change it.": "Paginile Parousia deschise se reîncarcă la schimbare.", "Parousia Desktop": "Parousia Desktop", - "Share Media Details": "Distribuie detaliile media", - "Include what you're watching or reading, not just the site's name.": "Includeți ceea ce vizionați sau citiți, nu doar numele site-ului.", + "Share media details": "Distribuie detaliile media", + "Include what you're watching or reading, not only the site's name.": "Includeți ceea ce vizionați sau citiți, nu doar numele site-ului.", + "Show media presence": "Afișează prezența media", + "Keep showing music and video activity when switching to websites without an enabled Activity.": "Continuați să afișați muzica și videoclipurile când treceți la site-uri fără o activitate activată.", "Shorter": "Mai scurt", "Longer": "Mai lung", "Pause activity": "Întrerupe activitatea", "Share as usual": "Distribuie ca de obicei", - "Incognito Behaviour": "Comportament în mod privat", - "What to do in private windows, if you've allowed Parousia there.": "Ce trebuie făcut în ferestrele private, dacă ați permis Parousia acolo.", + "Private windows": "Ferestre private", + "What to do in private windows you've allowed Parousia in.": "Ce se face în ferestrele private în care ați permis Parousia.", "What leaves your browser": "Ce părăsește browserul dvs.", - "Idle Timeout": "Timp de inactivitate", - "Keep sharing this long after you switch away from the browser. Sound playing keeps it going.": "Continuați să distribuiți atâta timp după ce părăsiți browserul. Redarea sunetului menține activitatea.", + "Idle timeout": "Timp de inactivitate", + "Keep sharing this long after you leave the browser. Sound keeps it going.": "Continuați să distribuiți atâta timp după ce părăsiți browserul. Sunetul care se redă menține distribuirea.", "What Activities may read": "Ce pot citi activitățile", - "On sites you've granted, Activities that read pages may take these. Switched off, Parousia doesn't read them, and doesn't show what an Activity's own code read.": "Pe site-urile pe care le-ați autorizat, activitățile care citesc pagini pot prelua aceste elemente. Când este dezactivat, Parousia nu le citește și nu afișează ce a citit codul propriu al unei activități.", + "On sites you've allowed, Activities that read pages may use these. When switched off, Parousia reads none of them and shows no page data from Activities.": "Pe site-urile pe care le-ați permis, activitățile care citesc pagini pot folosi acestea. Când sunt oprite, Parousia nu citește niciunul și nu afișează date de pagină din activități.", "{name} Rich Presence": "Rich Presence {name}", - "Show your activity on {name}.": "Afișați activitatea dvs. pe {name}.", - "Parousia Desktop shows your activity on these apps. Discord works now. Fluxer doesn't yet let other apps show activity on your profile, and Stoat is still being built, so those choices are saved for when they arrive.": "Parousia Desktop vă afișează activitatea pe aceste aplicații. Discord funcționează acum. Fluxer nu permite încă altor aplicații să afișeze activitatea pe profilul dvs., iar Stoat este încă în dezvoltare, așa că aceste opțiuni sunt salvate pentru când vor fi disponibile.", + "Show your presence on {name}.": "Afișați prezența dvs. pe {name}.", + "Parousia Desktop shows your presence on these apps. Discord works now. Fluxer doesn't let other apps show presence yet, and Stoat is still being built. Choices for them are saved until they arrive.": "Parousia Desktop vă afișează prezența în aceste aplicații. Discord funcționează deja. Fluxer nu permite încă altor aplicații să afișeze prezență, iar Stoat este încă în dezvoltare. Alegerile făcute pentru ele sunt salvate până la lansare.", "Discord-RPC-Extension": "Discord-RPC-Extension", - "Show Discord presence through Discord-RPC-Extension's app (discord_rpc_ext) on this computer, when it's running. Rich Presence only: nothing else is sent to it or accepted from it.": "Afișați prezența Discord prin aplicația Discord-RPC-Extension (discord_rpc_ext) pe acest computer, când rulează. Doar Rich Presence: nimic altceva nu îi este trimis sau acceptat de la ea.", + "Use Discord-RPC-Extension's app (discord_rpc_ext) on this computer when it's running. Only Rich Presence is sent to it or accepted from it.": "Folosiți aplicația Discord-RPC-Extension (discord_rpc_ext) de pe acest computer, când rulează. Doar Rich Presence este trimis către ea sau acceptat de la ea.", "Presence platforms": "Platforme de prezență", "Discord without Parousia Desktop": "Discord fără Parousia Desktop", "Other extensions": "Alte extensii", - "Show what MAL-Sync recognizes on anime and manga sites as your activity there, in place of the site's own. Parousia asks the MAL-Sync extension about the tab you're on and takes only Rich Presence from it. Turn off MAL-Sync's own Discord Rich Presence setting so it isn't shown twice.": "Afișați ceea ce MAL-Sync recunoaște pe site-urile de anime și manga ca activitatea dvs. acolo, în locul celei a site-ului. Parousia întreabă extensia MAL-Sync despre fila pe care vă aflați și preia doar Rich Presence de la ea. Dezactivați setarea proprie Discord Rich Presence din MAL-Sync pentru a evita afișarea dublă.", + "Show what MAL-Sync recognizes on anime and manga sites in place of the site's own. Parousia takes only Rich Presence from MAL-Sync. Turn off MAL-Sync's Discord Rich Presence setting so it isn't shown twice.": "Afișează ce recunoaște MAL-Sync pe site-urile de anime și manga, în locul celor ale site-ului. Parousia ia doar Rich Presence de la MAL-Sync. Dezactivați setarea Discord Rich Presence din MAL-Sync, ca să nu fie afișată de două ori.", "Parousia Desktop: {status}": "Parousia Desktop: {status}", "Off while Discord Rich Presence is off": "Oprit cât timp Discord Rich Presence este oprit", "Standing by while Parousia Desktop shows Discord": "În așteptare în timp ce Parousia Desktop afișează Discord", - "Access your data for all websites": "Accesați datele dvs. pentru toate site-urile web", - "Off by default. With it on, Activities that read pages can read any site, without asking site by site. Parousia never turns it on by itself.": "Dezactivat în mod implicit. Când este activat, activitățile care citesc pagini pot citi orice site, fără a cere permisiunea site cu site. Parousia nu îl activează niciodată de la sine.", + "Allow access to all websites": "Permite accesul la toate site-urile", + "Off by default. With it on, Activities that read pages can read any site without asking for each one. Parousia never turns it on by itself.": "Dezactivat implicit. Când este pornit, activitățile care citesc pagini pot citi orice site, fără să ceară pentru fiecare. Parousia nu îl pornește niciodată singură.", "All websites": "Toate site-urile web", - "Otherwise your browser asks before an Activity reads a site, when you turn the Activity on. Sites you allowed are managed in your browser's settings for this extension.": "În caz contrar, browserul dvs. vă întreabă înainte ca o activitate să citească un site, atunci când activați activitatea. Site-urile pe care le-ați permis sunt gestionate în setările browserului pentru această extensie.", + "Otherwise, your browser asks before an Activity reads a site, when you turn the Activity on. Manage the sites you've allowed in your browser's settings for this extension.": "În rest, browserul întreabă înainte ca o activitate să citească un site, când activați activitatea. Site-urile permise se gestionează din setările browserului pentru această extensie.", "Change in the dashboard": "Modificați în tabloul de bord", - "Your browser asks before granting access, which it does from the dashboard.": "Browserul dvs. solicită permisiunea înainte de a acorda accesul, lucru pe care îl face din tabloul de bord.", + "Your browser asks for access from the dashboard.": "Browserul cere accesul din panoul de control.", "Coming soon": "În curând", "Link accounts such as Jena Cloud to share presence without Parousia Desktop.": "Conectați conturi precum Jena Cloud pentru a distribui prezența fără Parousia Desktop.", "Extension": "Extensie", @@ -187,9 +189,9 @@ "Versions don't match": "Versiunile nu se potrivesc", "This extension and Parousia Desktop are different major versions. Update whichever is older.": "Această extensie și Parousia Desktop au versiuni majore diferite. Actualizați-o pe cea care este mai veche.", "Parousia Desktop couldn't be found": "Parousia Desktop nu a putut fi găsit", - "Launch Parousia Desktop to share your browser activity.": "Lansați Parousia Desktop pentru a distribui activitatea dvs. din browser.", + "Launch Parousia Desktop to share your presence.": "Porniți Parousia Desktop pentru a vă distribui prezența.", "Showing {activity}": "Se afișează {activity}", - "Showing your activity": "Se afișează activitatea dvs.", + "Showing your presence": "Se afișează prezența dvs.", "Ready": "Pregătit", "Connecting…": "Se conectează…", "Not running": "Nu rulează", @@ -197,21 +199,21 @@ "Refused": "Refuzat", "Connected, v{version}": "Conectat, v{version}", "Looking for it…": "Se caută…", - "No activity detected": "Nicio activitate detectată", - "Browse a supported site and it shows up here.": "Navigați pe un site acceptat și va apărea aici.", + "No Activity detected": "Nicio activitate detectată", + "Visit a supported site and it appears here.": "Vizitați un site compatibil și apare aici.", "Sharing {name}": "Se distribuie {name}", "Sharing now": "Se distribuie acum", "{time} elapsed": "Timp scurs: {time}", "Update Parousia Desktop": "Actualizează Parousia Desktop", "Get Parousia Desktop": "Obține Parousia Desktop", "Checking…": "Se verifică…", - "Retry Connection": "Reîncearcă conexiunea", - "Discord-RPC-Extension is running, so Discord can still show your activity without Parousia Desktop.": "Discord-RPC-Extension rulează, deci Discord vă poate afișa în continuare activitatea fără Parousia Desktop.", + "Retry connection": "Reîncearcă conexiunea", + "Discord-RPC-Extension is running, so Discord can still show your presence without Parousia Desktop.": "Discord-RPC-Extension rulează, așa că Discord vă poate afișa în continuare prezența fără Parousia Desktop.", "Parousia": "Parousia", "PAROUSIA": "PAROUSIA", "Settings": "Setări", - "Current activity": "Activitate curentă", - "Configure activity": "Configurează activitatea", + "Now sharing": "Se distribuie acum", + "Configure Activity": "Configurează activitatea", "PreMiD": "PreMiD", "Preferences": "Preferințe", "Changes apply right away.": "Modificările se aplică imediat.", @@ -235,17 +237,17 @@ "PreMiD Activities": "Activități PreMiD", "Clear filters": "Șterge filtrele", "Enable or disable all…": "Activează sau dezactivează tot…", - "Nothing matches that search and those filters.": "Nimic nu se potrivește cu acea căutare și acele filtre.", + "Nothing matches your search and filters.": "Nimic nu se potrivește cu căutarea și filtrele dvs.", "No Activities in this build yet": "Nicio activitate în această versiune deocamdată", - "Until one is added, Parousia recognizes no sites, so nothing about your browsing is shared.": "Până când este adăugată una, Parousia nu recunoaște niciun site, deci nimic din navigarea dvs. nu este distribuit.", + "Until one is added, Parousia recognizes no sites and shares nothing from your browsing.": "Până se adaugă una, Parousia nu recunoaște niciun site și nu distribuie nimic din navigarea dvs.", "All Activities": "Toate activitățile", "Implementation": "Implementare", - "Both Parousia and PreMiD have an Activity for this website. Only the one chosen runs.": "Atât Parousia, cât și PreMiD au o activitate pentru acest site web. Doar cea aleasă rulează.", + "Parousia and PreMiD both have an Activity for this website. Only the one you choose runs.": "Parousia și PreMiD au fiecare o activitate pentru acest site. Rulează doar cea pe care o alegeți.", "This Activity isn't in this build": "Această activitate nu se află în această versiune", "It may have been removed, or come from another version of Parousia.": "A fost posibil eliminată sau provine din altă versiune de Parousia.", - "What to share when the tab you're on has no Activity. Privacy settings and Settings > Platforms apply to it, as to any Activity.": "Ce să distribuiți când fila pe care vă aflați nu are nicio activitate. Setările de confidențialitate și Setări > Platforme i se aplică, ca oricărei activități.", + "What to share when the tab has no Activity. Privacy settings and Settings > Platforms apply to it, as they do to any Activity.": "Ce se distribuie când fila nu are nicio activitate. Setările de confidențialitate și Setări > Platforme i se aplică, ca oricărei activități.", "Preview": "Previzualizare", - "How Parousia behaves in this browser, and Parousia Desktop's own settings.": "Cum se comportă Parousia în acest browser și setările proprii ale Parousia Desktop.", + "How Parousia behaves in this browser, and Parousia Desktop's settings.": "Cum se comportă Parousia în acest browser și setările proprii ale Parousia Desktop.", "Dashboard": "Tablou de bord", "Search Activities or sites": "Caută activități sau site-uri", "Filter Activities": "Filtrează activitățile", @@ -253,28 +255,28 @@ "Activity pages": "Pagini de activități", "Settings categories": "Categorii de setări", "A newer Parousia Desktop is available": "Este disponibilă o versiune mai nouă de Parousia Desktop", - "This extension is newer than Parousia Desktop {version}. They still work together; update Desktop to get everything the extension offers.": "Această extensie este mai nouă decât Parousia Desktop {version}. Ele încă funcționează împreună; actualizați Desktop pentru a obține tot ce oferă extensia.", + "This extension is newer than Parousia Desktop {version}. They still work together. Update Desktop to get everything the extension offers.": "Această extensie este mai nouă decât Parousia Desktop {version}. Ele încă funcționează împreună; actualizați Desktop pentru a obține tot ce oferă extensia.", "A newer Parousia extension is available": "Este disponibilă o versiune mai nouă a extensiei Parousia", - "Parousia Desktop {version} is newer than this extension. They still work together; update the extension from your browser's extension page.": "Parousia Desktop {version} este mai nou decât această extensie. Ele încă funcționează împreună; actualizați extensia din pagina de extensii a browserului dvs.", + "Parousia Desktop {version} is newer than this extension. They still work together. Update the extension from your browser's extension page.": "Parousia Desktop {version} este mai nou decât această extensie. Ele încă funcționează împreună; actualizați extensia din pagina de extensii a browserului dvs.", "Not now": "Nu acum", "{n} Activities": { "one": "{n} activitate", "few": "{n} activități", "other": "{n} de activități" }, - "Enabled {count}. {n} Activities stayed off because their sites weren't granted.": { - "one": "Activate: {count}. {n} activitate a rămas dezactivată deoarece site-urile sale nu au fost permise.", - "few": "Activate: {count}. {n} activități au rămas dezactivate deoarece site-urile lor nu au fost permise.", - "other": "Activate: {count}. {n} de activități au rămas dezactivate deoarece site-urile lor nu au fost permise." + "Enabled {count}. {n} Activities stayed off because access to their sites was declined.": { + "one": "Activate: {count}. {n} activitate a rămas dezactivată, deoarece accesul la site-urile sale a fost refuzat.", + "few": "Activate: {count}. {n} activități au rămas dezactivate, deoarece accesul la site-urile lor a fost refuzat.", + "other": "Activate: {count}. {n} de activități au rămas dezactivate, deoarece accesul la site-urile lor a fost refuzat." }, "{n} Activities read pages.": { "one": "{n} activitate citește pagini.", "few": "{n} activități citesc pagini.", "other": "{n} de activități citesc pagini." }, - "Your browser will ask for access to {n} sites in one prompt, which can be long. Anything you decline stays off.": { - "one": "Browserul dvs. va solicita accesul la {n} site într-o singură solicitare, care poate fi lungă. Tot ce refuzați rămâne dezactivat.", - "few": "Browserul dvs. va solicita accesul la {n} site-uri într-o singură solicitare, care poate fi lungă. Tot ce refuzați rămâne dezactivat.", - "other": "Browserul dvs. va solicita accesul la {n} de site-uri într-o singură solicitare, care poate fi lungă. Tot ce refuzați rămâne dezactivat." + "Your browser asks for access to {n} sites in one prompt. Anything you decline stays off.": { + "one": "Browserul dvs. solicită accesul la {n} site dintr-o dată. Tot ce refuzați rămâne dezactivat.", + "few": "Browserul dvs. solicită accesul la {n} site-uri dintr-o dată. Tot ce refuzați rămâne dezactivat.", + "other": "Browserul dvs. solicită accesul la {n} de site-uri dintr-o dată. Tot ce refuzați rămâne dezactivat." } } diff --git a/browser/src/locales/ru.json b/browser/src/locales/ru.json index 94a2316..99f3fd7 100644 --- a/browser/src/locales/ru.json +++ b/browser/src/locales/ru.json @@ -2,23 +2,23 @@ "Off": "Выкл.", "1 h": "1 ч", "{n} min": "{n} мин", - "Give it a name of at least 2 characters.": "Задайте название не короче 2 символов.", - "Discord leaves out lines under 2 characters.": "Discord не показывает строки короче 2 символов.", - "Use an https image link, or an asset name from your own Discord Application.": "Укажите ссылку на изображение по https или имя ресурса из вашего приложения Discord.", + "Use a name of at least 2 characters.": "Введите название не короче 2 символов.", + "Discord drops lines shorter than 2 characters.": "Discord пропускает строки короче 2 символов.", + "Use an https image link, or an asset name from your Discord application.": "Укажите ссылку https на изображение или имя ресурса вашего приложения Discord.", "A button needs both a label and a link.": "Для кнопки нужны и подпись, и ссылка.", - "Button links start with https:// or http://.": "Ссылки кнопок начинаются с https:// или http://.", - "A Discord Application ID is 17 to 20 digits.": "ID приложения Discord состоит из 17–20 цифр.", - "{name} is on. Nothing to share on this page yet.": "{name} включена. На этой странице пока нечем делиться.", - "Nothing to share on this page.": "На этой странице нечем делиться.", - "Your browser didn't allow access to its sites, so it stays off.": "Браузер не разрешил доступ к её сайтам, поэтому она остаётся выключенной.", - "An Activity for this site, turned off. Turning it on asks your browser for access to {sites}.": "Для этого сайта есть активность, но она выключена. При включении браузер запросит доступ к {sites}.", - "An Activity for this site, turned off.": "Для этого сайта есть активность, но она выключена.", + "Button links must start with https:// or http://.": "Ссылки кнопок должны начинаться с https:// или http://.", + "A Discord application ID is 17 to 20 digits.": "ID приложения Discord состоит из 17–20 цифр.", + "{name} is on. Nothing to share here yet.": "{name} включена. Здесь пока нечем поделиться.", + "Nothing to share here.": "Здесь нечем поделиться.", + "Your browser declined access to its sites, so it stays off.": "Браузер отклонил доступ к её сайтам, поэтому она остаётся выключенной.", + "There's an Activity for this site, and it's off. Turning it on asks your browser for access to {sites}.": "Для этого сайта есть активность, и она выключена. При включении браузер запросит доступ к {sites}.", + "There's an Activity for this site, and it's off.": "Для этого сайта есть активность, и она выключена.", "Turn on": "Включить", - "Your browser didn't allow access to {sites}, so it still can't run here.": "Браузер не разрешил доступ к {sites}, поэтому она по-прежнему не может работать здесь.", - "It's on, but your browser hasn't given it access to {sites}, so it can't run here.": "Она включена, но браузер не дал ей доступ к {sites}, поэтому она не может работать здесь.", + "Your browser declined access to {sites}, so it still can't run here.": "Браузер отклонил доступ к {sites}, поэтому здесь она по-прежнему не работает.", + "It's on, but it has no access to {sites}, so it can't run here.": "Она включена, но у неё нет доступа к {sites}, поэтому здесь она не работает.", "Allow access": "Разрешить доступ", - "Show a Default Activity": "Показывать активность по умолчанию", - "Shared whenever the tab you're on has no Activity: a site none covers, a browser page, a new tab.": "Отображается, когда у текущей вкладки нет активности: сайт, который никто не поддерживает, страница браузера, новая вкладка.", + "Turn on the Default Activity": "Включить активность по умолчанию", + "Shared when the tab has no Activity: a site none covers, a browser page, or a new tab.": "Показывается, когда у вкладки нет активности: сайт без активности, страница браузера или новая вкладка.", "Name": "Название", "Shown as what you're doing, like \"Playing \". Required.": "Отображается как то, чем вы заняты, например «Играет в <название>». Обязательно.", "Details": "Подробности", @@ -26,20 +26,20 @@ "State": "Состояние", "The second line.": "Вторая строка.", "Large image": "Большое изображение", - "An https image link, or an asset name from your own Discord Application.": "Ссылка на изображение по https или имя ресурса из вашего приложения Discord.", + "An https image link, or an asset name from your Discord application.": "Ссылка https на изображение или имя ресурса вашего приложения Discord.", "Large image text": "Текст большого изображения", - "Shown when someone hovers over it.": "Показывается при наведении курсора.", + "Shown on hover.": "Показывается при наведении.", "Small image": "Малое изображение", "Shown in the large image's corner.": "Показывается в углу большого изображения.", "Small image text": "Текст малого изображения", - "Discord Application ID": "ID приложения Discord", - "Optional: show it as your own Discord Application instead of Parousia.": "Необязательно: показывать от имени вашего приложения Discord вместо Parousia.", + "Discord application ID": "ID приложения Discord", + "Optional. Show it as your own Discord application instead of Parousia.": "Необязательно. Показывать как ваше приложение Discord вместо Parousia.", "Button {n}": "Кнопка {n}", "Its label.": "Её подпись.", "Button {n} link": "Ссылка кнопки {n}", "Where it goes.": "Куда она ведёт.", "Show elapsed time": "Показывать прошедшее время", - "How long it's been shown, counted from when it started.": "Сколько времени она показывается, считая с момента начала.", + "Counts up from when it started.": "Отсчитывается с момента показа.", "Text": "Текст", "Images": "Изображения", "Buttons": "Кнопки", @@ -48,19 +48,19 @@ "Fix what's marked, then turn it on.": "Исправьте отмеченное, затем включите.", "On.": "Включено.", "Off.": "Выключено.", - "Not saved: fix what's marked.": "Не сохранено: исправьте отмеченное.", - "Saved. It's shown when no Activity is.": "Сохранено. Показывается, когда нет другой активности.", + "Not saved. Fix the marked fields.": "Не сохранено. Исправьте отмеченные поля.", + "Saved. It shows when no Activity has anything to share.": "Сохранено. Показывается, когда ни одна активность не может ничего передать.", "Saved. Turn it on above to share it.": "Сохранено. Чтобы делиться ею, включите её выше.", "Default Activity": "Активность по умолчанию", "{first} and {second}": "{first} и {second}", "{first}, {second}, and {n} more": "{first}, {second} и ещё {n}", - "Reads only the address and title of its pages, so it needs no site access.": "Читает только адрес и заголовок страниц, поэтому доступ к сайту не нужен.", - "Its own code reads its pages. Turning it on asks your browser for access to {sites}.": "Её собственный код читает её страницы. При включении браузер запросит доступ к {sites}.", - "Parousia reads what's playing on its pages. Turning it on asks your browser for access to {sites}.": "Parousia считывает, что воспроизводится на её страницах. При включении браузер запросит доступ к {sites}.", + "Reads only page addresses and titles, so it needs no site access.": "Читает только адреса и заголовки страниц, поэтому доступ к сайтам не нужен.", + "Its code reads the pages it runs on. Turning it on asks your browser for access to {sites}.": "Её код читает страницы, на которых работает. При включении браузер запросит доступ к {sites}.", + "Parousia reads what's playing on those pages. Turning it on asks your browser for access to {sites}.": "Parousia читает, что воспроизводится на этих страницах. При включении браузер запросит доступ к {sites}.", "Show this Activity": "Показывать эту активность", - "It stays off: your browser didn't allow access to {sites}.": "Она остаётся выключенной: браузер не разрешил доступ к {sites}.", - "Your browser didn't allow access to {sites}, so it still doesn't run there.": "Браузер не разрешил доступ к {sites}, поэтому она по-прежнему там не работает.", - "It's on, but can't read {sites}, so it doesn't run there. Access was declined or taken back.": "Она включена, но не может читать {sites}, поэтому там не работает. Доступ был отклонён или отозван.", + "It stays off: your browser declined access to {sites}.": "Она остаётся выключенной: браузер отклонил доступ к {sites}.", + "Your browser declined access to {sites}, so it still doesn't run there.": "Браузер отклонил доступ к {sites}, поэтому там она по-прежнему не работает.", + "It's on, but can't read {sites}, so it doesn't run there. Access was declined or revoked.": "Она включена, но не может читать {sites}, поэтому там не работает. Доступ был отклонён или отозван.", "PreMiD: {name}": "PreMiD: {name}", "Sites": "Сайты", "From": "Источник", @@ -68,24 +68,24 @@ "Activity": "Активность", "Needs access": "Нужен доступ", "Access declined": "Доступ отклонён", - "multi": "несколько", + "2 sources": "2 источника", "Show {name}": "Показывать {name}", "Filter, {n} selected": "Фильтр, выбрано: {n}", "Filter": "Фильтр", "Enabled {count}.": "Включено: {count}.", - "Nothing was enabled: your browser didn't grant access to their sites.": "Ничего не включено: браузер не дал доступ к их сайтам.", + "Nothing was enabled. Your browser declined access to their sites.": "Ничего не включено. Браузер отклонил доступ к их сайтам.", "Couldn't change the Activities. Try again.": "Не удалось изменить активности. Повторите попытку.", "Nothing was on.": "Ничего не было включено.", "Disabled {count}.": "Отключено: {count}.", - "No Activities match, so there is nothing to change.": "Подходящих активностей нет, менять нечего.", - "This applies to the {count} matching your search and filters, on every page.": "Это относится ко всем активностям, подходящим под ваш поиск и фильтры, на всех страницах: {count}.", + "No Activities match, so there's nothing to change.": "Подходящих активностей нет, менять нечего.", + "This applies to all {count} matching your search and filters, not only this page.": "Применяется ко всем {count} подходящим под поиск и фильтры, а не только к этой странице.", "Enable {count}?": "Включить {count}?", - "None of them needs access to a new site, so your browser won't ask for anything.": "Ни одной из них не нужен доступ к новому сайту, поэтому браузер ничего не запросит.", + "None needs access to a new site, so your browser won't ask.": "Ни одной не нужен доступ к новому сайту, поэтому браузер ничего не спросит.", "Cancel": "Отмена", "Enable {count}": "Включить {count}", "Disable {count}": "Отключить {count}", "Disable {count}?": "Отключить {count}?", - "Sites only they used are given back to your browser.": "Сайты, которые использовали только они, возвращаются браузеру.", + "Sites only they use are given back to your browser.": "Сайты, которые используют только они, возвращаются браузеру.", "Enable all ({n})": "Включить все ({n})", "Disable all ({n})": "Отключить все ({n})", "{first}–{last} of {total}": "{first}–{last} из {total}", @@ -100,7 +100,7 @@ "Appearance": "Оформление", "Theme": "Тема", "Privacy": "Конфиденциальность", - "What's shared, what Activities read, incognito": "Что передаётся, что читают активности, режим инкогнито", + "What's shared, what Activities read, private windows": "Что передаётся, что читают активности, приватные окна", "Site access": "Доступ к сайтам", "Access to all websites": "Доступ ко всем сайтам", "Platforms": "Платформы", @@ -112,7 +112,7 @@ "What's playing": "Что воспроизводится", "Titles, artists, and progress of what you're watching or listening to.": "Названия, исполнители и ход воспроизведения того, что вы смотрите или слушаете.", "Thumbnails": "Миниатюры", - "Images of what you're watching or reading, such as a video's thumbnail or an album cover.": "Изображения того, что вы смотрите или читаете, например миниатюра видео или обложка альбома.", + "Images of what you're watching or reading, like a video thumbnail or album cover.": "Изображения того, что вы смотрите или читаете, например превью видео или обложка альбома.", "Creator icons": "Значки авторов", "Pictures of the channel, artist, or creator.": "Изображения канала, исполнителя или автора.", "Atelier": "Atelier", @@ -124,42 +124,44 @@ "Automatic": "Автоматически", "Connect to Parousia Desktop to see and change these.": "Подключитесь к Parousia Desktop, чтобы видеть и менять эти настройки.", "Allow userscripts": "Разрешить пользовательские скрипты", - "Any web page can connect while this is on. Userscripts can only publish presence, never read status or change settings.": "Пока включено, подключиться может любая веб-страница. Пользовательские скрипты могут только публиковать статус, но не читать состояние и не менять настройки.", - "Parousia Desktop couldn't confirm this connection is yours, so these can't be changed from here. Use the Parousia-Desktop set command or Desktop's own console instead.": "Parousia Desktop не смог подтвердить, что это ваше подключение, поэтому менять эти настройки отсюда нельзя. Используйте команду Parousia-Desktop set или консоль самого Desktop.", + "Any web page can connect while this is on. Userscripts can only send presence, not read status or change settings.": "Пока это включено, к Parousia может подключиться любая веб-страница. Юзерскрипты могут только передавать статус, но не читать состояние и не менять настройки.", + "Parousia Desktop couldn't confirm this connection is yours, so you can't change these here. Use the Parousia-Desktop set command or Desktop's console instead.": "Parousia Desktop не смог подтвердить, что это подключение ваше, поэтому здесь эти настройки не меняются. Используйте команду Parousia-Desktop set или консоль Desktop.", "Language": "Язык", - "Changing it reloads any open Parousia page.": "При смене языка все открытые страницы Parousia перезагружаются.", + "Open Parousia pages reload when you change it.": "При смене открытые страницы Parousia перезагружаются.", "Parousia Desktop": "Parousia Desktop", - "Share Media Details": "Передавать сведения о медиа", - "Include what you're watching or reading, not just the site's name.": "Показывать, что вы смотрите или читаете, а не только название сайта.", + "Share media details": "Передавать сведения о медиа", + "Include what you're watching or reading, not only the site's name.": "Показывать, что вы смотрите или читаете, а не только название сайта.", + "Show media presence": "Показывать статус медиа", + "Keep showing music and video activity when switching to websites without an enabled Activity.": "Продолжать показывать музыку и видео при переходе на сайты без включённой активности.", "Shorter": "Короче", "Longer": "Дольше", "Pause activity": "Приостанавливать активность", "Share as usual": "Передавать как обычно", - "Incognito Behaviour": "Поведение в режиме инкогнито", - "What to do in private windows, if you've allowed Parousia there.": "Что делать в приватных окнах, если вы разрешили там Parousia.", + "Private windows": "Приватные окна", + "What to do in private windows you've allowed Parousia in.": "Что делать в приватных окнах, где вы разрешили Parousia работать.", "What leaves your browser": "Что покидает ваш браузер", - "Idle Timeout": "Время простоя", - "Keep sharing this long after you switch away from the browser. Sound playing keeps it going.": "Продолжать передачу столько времени после того, как вы покинули браузер. Пока воспроизводится звук, передача не прекращается.", + "Idle timeout": "Время простоя", + "Keep sharing this long after you leave the browser. Sound keeps it going.": "Продолжать передачу столько времени после ухода из браузера. Звук, который воспроизводится, продлевает передачу.", "What Activities may read": "Что могут читать активности", - "On sites you've granted, Activities that read pages may take these. Switched off, Parousia doesn't read them, and doesn't show what an Activity's own code read.": "На сайтах, к которым вы разрешили доступ, активности, читающие страницы, могут брать эти данные. Если выключить, Parousia их не читает и не показывает то, что прочитал собственный код активности.", + "On sites you've allowed, Activities that read pages may use these. When switched off, Parousia reads none of them and shows no page data from Activities.": "На разрешённых сайтах активности, которые читают страницы, могут использовать эти данные. Когда выключено, Parousia ничего не читает и не показывает данные страниц из активностей.", "{name} Rich Presence": "Rich Presence в {name}", - "Show your activity on {name}.": "Показывать вашу активность в {name}.", - "Parousia Desktop shows your activity on these apps. Discord works now. Fluxer doesn't yet let other apps show activity on your profile, and Stoat is still being built, so those choices are saved for when they arrive.": "Parousia Desktop показывает вашу активность в этих приложениях. Discord работает уже сейчас. Fluxer пока не позволяет другим приложениям показывать активность в вашем профиле, а Stoat ещё разрабатывается, поэтому эти настройки сохраняются до их появления.", + "Show your presence on {name}.": "Показывать ваш статус в {name}.", + "Parousia Desktop shows your presence on these apps. Discord works now. Fluxer doesn't let other apps show presence yet, and Stoat is still being built. Choices for them are saved until they arrive.": "Parousia Desktop показывает ваш статус в этих приложениях. Discord уже работает. Fluxer пока не позволяет другим приложениям показывать статус, а Stoat ещё в разработке. Выбор для них сохраняется до их появления.", "Discord-RPC-Extension": "Discord-RPC-Extension", - "Show Discord presence through Discord-RPC-Extension's app (discord_rpc_ext) on this computer, when it's running. Rich Presence only: nothing else is sent to it or accepted from it.": "Показывать статус Discord через приложение Discord-RPC-Extension (discord_rpc_ext) на этом компьютере, когда оно запущено. Только Rich Presence: больше ничего ему не передаётся и от него не принимается.", + "Use Discord-RPC-Extension's app (discord_rpc_ext) on this computer when it's running. Only Rich Presence is sent to it or accepted from it.": "Использовать приложение Discord-RPC-Extension (discord_rpc_ext) на этом компьютере, когда оно запущено. Ему передаётся и от него принимается только Rich Presence.", "Presence platforms": "Платформы статуса", "Discord without Parousia Desktop": "Discord без Parousia Desktop", "Other extensions": "Другие расширения", - "Show what MAL-Sync recognizes on anime and manga sites as your activity there, in place of the site's own. Parousia asks the MAL-Sync extension about the tab you're on and takes only Rich Presence from it. Turn off MAL-Sync's own Discord Rich Presence setting so it isn't shown twice.": "Показывать то, что MAL-Sync распознаёт на сайтах аниме и манги, как вашу активность вместо активности самого сайта. Parousia спрашивает расширение MAL-Sync о текущей вкладке и принимает от него только Rich Presence. Отключите собственную настройку Discord Rich Presence в MAL-Sync, чтобы статус не показывался дважды.", + "Show what MAL-Sync recognizes on anime and manga sites in place of the site's own. Parousia takes only Rich Presence from MAL-Sync. Turn off MAL-Sync's Discord Rich Presence setting so it isn't shown twice.": "Показывать то, что MAL-Sync распознаёт на сайтах аниме и манги, вместо собственного отображения сайта. Parousia получает от MAL-Sync только Rich Presence. Выключите у MAL-Sync настройку Discord Rich Presence, чтобы статус не дублировался.", "Parousia Desktop: {status}": "Parousia Desktop: {status}", "Off while Discord Rich Presence is off": "Выключено, пока выключен Discord Rich Presence", "Standing by while Parousia Desktop shows Discord": "Ожидание, пока Parousia Desktop показывает статус в Discord", - "Access your data for all websites": "Доступ к вашим данным на всех сайтах", - "Off by default. With it on, Activities that read pages can read any site, without asking site by site. Parousia never turns it on by itself.": "По умолчанию выключено. Если включить, активности, читающие страницы, смогут читать любой сайт без запроса для каждого сайта отдельно. Parousia никогда не включает это сама.", + "Allow access to all websites": "Разрешить доступ ко всем сайтам", + "Off by default. With it on, Activities that read pages can read any site without asking for each one. Parousia never turns it on by itself.": "По умолчанию выключено. Когда включено, активности, которые читают страницы, могут читать любой сайт без запроса для каждого. Parousia никогда не включает это сама.", "All websites": "Все сайты", - "Otherwise your browser asks before an Activity reads a site, when you turn the Activity on. Sites you allowed are managed in your browser's settings for this extension.": "Иначе браузер спрашивает разрешение, прежде чем активность прочитает сайт, когда вы включаете активность. Разрешённые сайты настраиваются в параметрах этого расширения в браузере.", + "Otherwise, your browser asks before an Activity reads a site, when you turn the Activity on. Manage the sites you've allowed in your browser's settings for this extension.": "В остальных случаях браузер спрашивает перед тем, как активность прочитает сайт, когда вы её включаете. Разрешёнными сайтами управляйте в настройках браузера для этого расширения.", "Change in the dashboard": "Изменить на панели управления", - "Your browser asks before granting access, which it does from the dashboard.": "Браузер запрашивает разрешение перед предоставлением доступа, и делает это из панели управления.", + "Your browser asks for access from the dashboard.": "Браузер запрашивает доступ из панели управления.", "Coming soon": "Скоро", "Link accounts such as Jena Cloud to share presence without Parousia Desktop.": "Свяжите аккаунты, например Jena Cloud, чтобы делиться статусом без Parousia Desktop.", "Extension": "Расширение", @@ -187,9 +189,9 @@ "Versions don't match": "Версии не совпадают", "This extension and Parousia Desktop are different major versions. Update whichever is older.": "Основные версии этого расширения и Parousia Desktop различаются. Обновите более старую.", "Parousia Desktop couldn't be found": "Parousia Desktop не найден", - "Launch Parousia Desktop to share your browser activity.": "Запустите Parousia Desktop, чтобы делиться активностью в браузере.", + "Launch Parousia Desktop to share your presence.": "Запустите Parousia Desktop, чтобы передавать ваш статус.", "Showing {activity}": "Показывает: {activity}", - "Showing your activity": "Показывает вашу активность", + "Showing your presence": "Показывается ваш статус", "Ready": "Готово", "Connecting…": "Подключение…", "Not running": "Не запущено", @@ -197,21 +199,21 @@ "Refused": "Отказ", "Connected, v{version}": "Подключено, v{version}", "Looking for it…": "Поиск…", - "No activity detected": "Активность не обнаружена", - "Browse a supported site and it shows up here.": "Откройте поддерживаемый сайт, и она появится здесь.", + "No Activity detected": "Активность не обнаружена", + "Visit a supported site and it appears here.": "Откройте поддерживаемый сайт, и он появится здесь.", "Sharing {name}": "Передаётся: {name}", "Sharing now": "Передаётся сейчас", "{time} elapsed": "Прошло: {time}", "Update Parousia Desktop": "Обновить Parousia Desktop", "Get Parousia Desktop": "Скачать Parousia Desktop", "Checking…": "Проверка…", - "Retry Connection": "Повторить подключение", - "Discord-RPC-Extension is running, so Discord can still show your activity without Parousia Desktop.": "Discord-RPC-Extension запущен, поэтому Discord по-прежнему может показывать вашу активность без Parousia Desktop.", + "Retry connection": "Повторить подключение", + "Discord-RPC-Extension is running, so Discord can still show your presence without Parousia Desktop.": "Discord-RPC-Extension запущен, поэтому Discord может показывать ваш статус и без Parousia Desktop.", "Parousia": "Parousia", "PAROUSIA": "PAROUSIA", "Settings": "Настройки", - "Current activity": "Текущая активность", - "Configure activity": "Настроить активность", + "Now sharing": "Передаётся сейчас", + "Configure Activity": "Настроить активность", "PreMiD": "PreMiD", "Preferences": "Параметры", "Changes apply right away.": "Изменения применяются сразу.", @@ -235,17 +237,17 @@ "PreMiD Activities": "Активности PreMiD", "Clear filters": "Сбросить фильтры", "Enable or disable all…": "Включить или отключить все…", - "Nothing matches that search and those filters.": "По этому запросу и фильтрам ничего не найдено.", + "Nothing matches your search and filters.": "Ничего не подходит под поиск и фильтры.", "No Activities in this build yet": "В этой сборке пока нет активностей", - "Until one is added, Parousia recognizes no sites, so nothing about your browsing is shared.": "Пока не добавлена хотя бы одна, Parousia не распознаёт ни одного сайта, поэтому ничего о вашем просмотре не передаётся.", + "Until one is added, Parousia recognizes no sites and shares nothing from your browsing.": "Пока ни одной не добавлено, Parousia не распознаёт сайты и ничего не передаёт из вашего просмотра.", "All Activities": "Все активности", "Implementation": "Реализация", - "Both Parousia and PreMiD have an Activity for this website. Only the one chosen runs.": "У Parousia и у PreMiD есть активность для этого сайта. Работает только выбранная.", + "Parousia and PreMiD both have an Activity for this website. Only the one you choose runs.": "Для этого сайта есть активности и в Parousia, и в PreMiD. Работает только выбранная.", "This Activity isn't in this build": "Этой активности нет в этой сборке", "It may have been removed, or come from another version of Parousia.": "Возможно, её удалили, или она из другой версии Parousia.", - "What to share when the tab you're on has no Activity. Privacy settings and Settings > Platforms apply to it, as to any Activity.": "Чем делиться, когда у текущей вкладки нет активности. К ней, как и к любой активности, применяются настройки конфиденциальности и Настройки > Платформы.", + "What to share when the tab has no Activity. Privacy settings and Settings > Platforms apply to it, as they do to any Activity.": "Что показывать, когда у вкладки нет активности. К ней, как и к любой активности, применяются настройки конфиденциальности и «Настройки > Платформы».", "Preview": "Предпросмотр", - "How Parousia behaves in this browser, and Parousia Desktop's own settings.": "Как Parousia работает в этом браузере, а также собственные настройки Parousia Desktop.", + "How Parousia behaves in this browser, and Parousia Desktop's settings.": "Как Parousia работает в этом браузере, а также собственные настройки Parousia Desktop.", "Dashboard": "Панель управления", "Search Activities or sites": "Поиск активностей или сайтов", "Filter Activities": "Фильтр активностей", @@ -253,9 +255,9 @@ "Activity pages": "Страницы активностей", "Settings categories": "Категории настроек", "A newer Parousia Desktop is available": "Доступна новая версия Parousia Desktop", - "This extension is newer than Parousia Desktop {version}. They still work together; update Desktop to get everything the extension offers.": "Это расширение новее, чем Parousia Desktop {version}. Они по-прежнему работают вместе; обновите Desktop, чтобы получить все возможности расширения.", + "This extension is newer than Parousia Desktop {version}. They still work together. Update Desktop to get everything the extension offers.": "Это расширение новее, чем Parousia Desktop {version}. Они по-прежнему работают вместе; обновите Desktop, чтобы получить все возможности расширения.", "A newer Parousia extension is available": "Доступна новая версия расширения Parousia", - "Parousia Desktop {version} is newer than this extension. They still work together; update the extension from your browser's extension page.": "Parousia Desktop {version} новее, чем это расширение. Они по-прежнему работают вместе; обновите расширение на странице расширений вашего браузера.", + "Parousia Desktop {version} is newer than this extension. They still work together. Update the extension from your browser's extension page.": "Parousia Desktop {version} новее, чем это расширение. Они по-прежнему работают вместе; обновите расширение на странице расширений вашего браузера.", "Not now": "Не сейчас", "{n} Activities": { "one": "{n} активность", @@ -263,11 +265,11 @@ "many": "{n} активностей", "other": "{n} активности" }, - "Enabled {count}. {n} Activities stayed off because their sites weren't granted.": { - "one": "Включено: {count}. {n} активность осталась выключенной, потому что доступ к её сайтам не дали.", - "few": "Включено: {count}. {n} активности остались выключенными, потому что доступ к их сайтам не дали.", - "many": "Включено: {count}. {n} активностей остались выключенными, потому что доступ к их сайтам не дали.", - "other": "Включено: {count}. {n} активности остались выключенными, потому что доступ к их сайтам не дали." + "Enabled {count}. {n} Activities stayed off because access to their sites was declined.": { + "one": "Включено: {count}. {n} активность осталась выключенной, потому что доступ к её сайтам отклонён.", + "few": "Включено: {count}. {n} активности остались выключенными, потому что доступ к их сайтам отклонён.", + "many": "Включено: {count}. {n} активностей остались выключенными, потому что доступ к их сайтам отклонён.", + "other": "Включено: {count}. {n} активности остались выключенными, потому что доступ к их сайтам отклонён." }, "{n} Activities read pages.": { "one": "{n} активность читает страницы.", @@ -275,10 +277,10 @@ "many": "{n} активностей читают страницы.", "other": "{n} активности читают страницы." }, - "Your browser will ask for access to {n} sites in one prompt, which can be long. Anything you decline stays off.": { - "one": "Браузер одним запросом спросит доступ к {n} сайту, это может занять много времени. Всё, что вы отклоните, останется выключенным.", - "few": "Браузер одним запросом спросит доступ к {n} сайтам, это может занять много времени. Всё, что вы отклоните, останется выключенным.", - "many": "Браузер одним запросом спросит доступ к {n} сайтам, это может занять много времени. Всё, что вы отклоните, останется выключенным.", - "other": "Браузер одним запросом спросит доступ к {n} сайта, это может занять много времени. Всё, что вы отклоните, останется выключенным." + "Your browser asks for access to {n} sites in one prompt. Anything you decline stays off.": { + "one": "Браузер одним запросом спросит доступ к {n} сайту. Всё, что вы отклоните, останется выключенным.", + "few": "Браузер одним запросом спросит доступ к {n} сайтам. Всё, что вы отклоните, останется выключенным.", + "many": "Браузер одним запросом спросит доступ к {n} сайтам. Всё, что вы отклоните, останется выключенным.", + "other": "Браузер одним запросом спросит доступ к {n} сайтам. Всё, что вы отклоните, останется выключенным." } } diff --git a/browser/src/locales/sv.json b/browser/src/locales/sv.json index 32374e8..e4eab2e 100644 --- a/browser/src/locales/sv.json +++ b/browser/src/locales/sv.json @@ -2,23 +2,23 @@ "Off": "Av", "1 h": "1 tim", "{n} min": "{n} min", - "Give it a name of at least 2 characters.": "Ange ett namn med minst 2 tecken.", - "Discord leaves out lines under 2 characters.": "Discord utelämnar rader under 2 tecken.", - "Use an https image link, or an asset name from your own Discord Application.": "Använd en https-bildlänk eller ett resursnamn från din egen Discord-applikation.", + "Use a name of at least 2 characters.": "Använd ett namn med minst 2 tecken.", + "Discord drops lines shorter than 2 characters.": "Discord utelämnar rader med färre än 2 tecken.", + "Use an https image link, or an asset name from your Discord application.": "Använd en https-bildlänk eller ett tillgångsnamn från din Discord-applikation.", "A button needs both a label and a link.": "En knapp behöver både en etikett och en länk.", - "Button links start with https:// or http://.": "Knapplänkar måste börja med https:// eller http://.", - "A Discord Application ID is 17 to 20 digits.": "Ett Discord-applikations-ID består av 17 till 20 siffror.", - "{name} is on. Nothing to share on this page yet.": "{name} är på. Inget att dela på den här sidan än.", - "Nothing to share on this page.": "Inget att dela på den här sidan.", - "Your browser didn't allow access to its sites, so it stays off.": "Din webbläsare tillät inte åtkomst till dess webbplatser, så den förblir avstängd.", - "An Activity for this site, turned off. Turning it on asks your browser for access to {sites}.": "En aktivitet för den här webbplatsen är avstängd. Om du slår på den ber din webbläsare om åtkomst till {sites}.", - "An Activity for this site, turned off.": "En aktivitet för den här webbplatsen är avstängd.", + "Button links must start with https:// or http://.": "Knapplänkar måste börja med https:// eller http://.", + "A Discord application ID is 17 to 20 digits.": "Ett Discord-applikations-ID har 17 till 20 siffror.", + "{name} is on. Nothing to share here yet.": "{name} är på. Det finns inget att dela här ännu.", + "Nothing to share here.": "Det finns inget att dela här.", + "Your browser declined access to its sites, so it stays off.": "Din webbläsare nekade åtkomst till dess webbplatser, så den förblir avstängd.", + "There's an Activity for this site, and it's off. Turning it on asks your browser for access to {sites}.": "Det finns en aktivitet för den här webbplatsen, och den är av. Om du slår på den frågar webbläsaren efter åtkomst till {sites}.", + "There's an Activity for this site, and it's off.": "Det finns en aktivitet för den här webbplatsen, och den är av.", "Turn on": "Slå på", - "Your browser didn't allow access to {sites}, so it still can't run here.": "Din webbläsare tillät inte åtkomst till {sites}, så den kan fortfarande inte köras här.", - "It's on, but your browser hasn't given it access to {sites}, so it can't run here.": "Den är på, men din webbläsare har inte gett den åtkomst till {sites}, så den kan inte köras här.", + "Your browser declined access to {sites}, so it still can't run here.": "Din webbläsare nekade åtkomst till {sites}, så den går fortfarande inte att köra här.", + "It's on, but it has no access to {sites}, so it can't run here.": "Den är på men saknar åtkomst till {sites}, så den kan inte köras här.", "Allow access": "Tillåt åtkomst", - "Show a Default Activity": "Visa en standardaktivitet", - "Shared whenever the tab you're on has no Activity: a site none covers, a browser page, a new tab.": "Delas när fliken du är på saknar aktivitet: en webbplats som inte täcks, en webbläsarsida eller en ny flik.", + "Turn on the Default Activity": "Slå på standardaktiviteten", + "Shared when the tab has no Activity: a site none covers, a browser page, or a new tab.": "Delas när fliken saknar aktivitet: en webbplats utan aktivitet, en webbläsarsida eller en ny flik.", "Name": "Namn", "Shown as what you're doing, like \"Playing \". Required.": "Visas som det du gör, till exempel ”Spelar ”. Obligatoriskt.", "Details": "Detaljer", @@ -26,20 +26,20 @@ "State": "Status", "The second line.": "Den andra raden.", "Large image": "Stor bild", - "An https image link, or an asset name from your own Discord Application.": "En https-bildlänk eller ett resursnamn från din egen Discord-applikation.", + "An https image link, or an asset name from your Discord application.": "En https-bildlänk eller ett tillgångsnamn från din Discord-applikation.", "Large image text": "Text för stor bild", - "Shown when someone hovers over it.": "Visas när någon för pekaren över den.", + "Shown on hover.": "Visas vid hovring.", "Small image": "Liten bild", "Shown in the large image's corner.": "Visas i hörnet av den stora bilden.", "Small image text": "Text för liten bild", - "Discord Application ID": "ID för Discord-applikation", - "Optional: show it as your own Discord Application instead of Parousia.": "Valfritt: visa det som din egen Discord-applikation istället för Parousia.", + "Discord application ID": "Discord-applikations-ID", + "Optional. Show it as your own Discord application instead of Parousia.": "Valfritt. Visa den som din egen Discord-applikation i stället för Parousia.", "Button {n}": "Knapp {n}", "Its label.": "Dess etikett.", "Button {n} link": "Länk för knapp {n}", "Where it goes.": "Vart den leder.", "Show elapsed time": "Visa förfluten tid", - "How long it's been shown, counted from when it started.": "Hur länge den har visats, räknat från när den startade.", + "Counts up from when it started.": "Räknar från när den började visas.", "Text": "Text", "Images": "Bilder", "Buttons": "Knappar", @@ -48,19 +48,19 @@ "Fix what's marked, then turn it on.": "Åtgärda det som är markerat och slå sedan på den.", "On.": "På.", "Off.": "Av.", - "Not saved: fix what's marked.": "Inte sparad: åtgärda det som är markerat.", - "Saved. It's shown when no Activity is.": "Sparad. Visas när ingen aktivitet är igång.", + "Not saved. Fix the marked fields.": "Inte sparat. Rätta de markerade fälten.", + "Saved. It shows when no Activity has anything to share.": "Sparat. Den visas när ingen aktivitet har något att dela.", "Saved. Turn it on above to share it.": "Sparad. Slå på den ovan för att dela den.", "Default Activity": "Standardaktivitet", "{first} and {second}": "{first} och {second}", "{first}, {second}, and {n} more": "{first}, {second} och {n} till", - "Reads only the address and title of its pages, so it needs no site access.": "Läser endast adressen och titeln på sina sidor, så den behöver ingen webbplatsåtkomst.", - "Its own code reads its pages. Turning it on asks your browser for access to {sites}.": "Dess egen kod läser av dess sidor. Om du slår på den ber din webbläsare om åtkomst till {sites}.", - "Parousia reads what's playing on its pages. Turning it on asks your browser for access to {sites}.": "Parousia läser vad som spelas på dess sidor. Om du slår på den ber din webbläsare om åtkomst till {sites}.", + "Reads only page addresses and titles, so it needs no site access.": "Läser bara sidornas adresser och titlar, så den behöver ingen åtkomst till webbplatser.", + "Its code reads the pages it runs on. Turning it on asks your browser for access to {sites}.": "Dess kod läser sidorna den körs på. Om du slår på den frågar webbläsaren efter åtkomst till {sites}.", + "Parousia reads what's playing on those pages. Turning it on asks your browser for access to {sites}.": "Parousia läser vad som spelas upp på de här sidorna. Om du slår på den frågar webbläsaren efter åtkomst till {sites}.", "Show this Activity": "Visa denna aktivitet", - "It stays off: your browser didn't allow access to {sites}.": "Den förblir avstängd: din webbläsare tillät inte åtkomst till {sites}.", - "Your browser didn't allow access to {sites}, so it still doesn't run there.": "Din webbläsare tillät inte åtkomst till {sites}, så den körs fortfarande inte där.", - "It's on, but can't read {sites}, so it doesn't run there. Access was declined or taken back.": "Den är på, men kan inte läsa {sites}, så den körs inte där. Åtkomsten nekades eller återkallades.", + "It stays off: your browser declined access to {sites}.": "Den förblir avstängd: din webbläsare nekade åtkomst till {sites}.", + "Your browser declined access to {sites}, so it still doesn't run there.": "Din webbläsare nekade åtkomst till {sites}, så den körs fortfarande inte där.", + "It's on, but can't read {sites}, so it doesn't run there. Access was declined or revoked.": "Den är på men kan inte läsa {sites}, så den körs inte där. Åtkomsten nekades eller återkallades.", "PreMiD: {name}": "PreMiD: {name}", "Sites": "Webbplatser", "From": "Från", @@ -68,24 +68,24 @@ "Activity": "Aktivitet", "Needs access": "Kräver åtkomst", "Access declined": "Åtkomst nekad", - "multi": "multi", + "2 sources": "2 källor", "Show {name}": "Visa {name}", "Filter, {n} selected": "Filter, {n} valda", "Filter": "Filter", "Enabled {count}.": "Aktiverade: {count}.", - "Nothing was enabled: your browser didn't grant access to their sites.": "Inget aktiverades: din webbläsare beviljade inte åtkomst till deras webbplatser.", + "Nothing was enabled. Your browser declined access to their sites.": "Inget aktiverades. Din webbläsare nekade åtkomst till deras webbplatser.", "Couldn't change the Activities. Try again.": "Det gick inte att ändra aktiviteterna. Försök igen.", "Nothing was on.": "Inget var igång.", "Disabled {count}.": "Inaktiverade: {count}.", - "No Activities match, so there is nothing to change.": "Inga aktiviteter matchar, så det finns inget att ändra.", - "This applies to the {count} matching your search and filters, on every page.": "Detta gäller för de {count} som matchar din sökning och dina filter, på alla sidor.", + "No Activities match, so there's nothing to change.": "Inga aktiviteter matchar, så det finns inget att ändra.", + "This applies to all {count} matching your search and filters, not only this page.": "Det gäller alla {count} som matchar din sökning och dina filter, inte bara den här sidan.", "Enable {count}?": "Aktivera {count}?", - "None of them needs access to a new site, so your browser won't ask for anything.": "Ingen av dem behöver åtkomst till en ny webbplats, så din webbläsare kommer inte att be om något.", + "None needs access to a new site, so your browser won't ask.": "Ingen behöver åtkomst till en ny webbplats, så webbläsaren frågar inte.", "Cancel": "Avbryt", "Enable {count}": "Aktivera {count}", "Disable {count}": "Inaktivera {count}", "Disable {count}?": "Inaktivera {count}?", - "Sites only they used are given back to your browser.": "Webbplatser som endast de använde återlämnas till din webbläsare.", + "Sites only they use are given back to your browser.": "Webbplatser som bara de använder återlämnas till din webbläsare.", "Enable all ({n})": "Aktivera alla ({n})", "Disable all ({n})": "Inaktivera alla ({n})", "{first}–{last} of {total}": "{first}–{last} av {total}", @@ -100,7 +100,7 @@ "Appearance": "Utseende", "Theme": "Tema", "Privacy": "Integritet", - "What's shared, what Activities read, incognito": "Vad som delas, vad aktiviteter läser, inkognito", + "What's shared, what Activities read, private windows": "Vad som delas, vad aktiviteter läser, privata fönster", "Site access": "Webbplatsåtkomst", "Access to all websites": "Åtkomst till alla webbplatser", "Platforms": "Plattformar", @@ -112,7 +112,7 @@ "What's playing": "Spelas nu", "Titles, artists, and progress of what you're watching or listening to.": "Titlar, artister och förlopp för det du tittar på eller lyssnar på.", "Thumbnails": "Miniatyrbilder", - "Images of what you're watching or reading, such as a video's thumbnail or an album cover.": "Bilder på det du tittar på eller läser, som en videominiatyr eller ett albumomslag.", + "Images of what you're watching or reading, like a video thumbnail or album cover.": "Bilder på det du tittar på eller läser, till exempel en videominiatyr eller ett albumomslag.", "Creator icons": "Skaparikoner", "Pictures of the channel, artist, or creator.": "Bilder på kanalen, artisten eller skaparen.", "Atelier": "Atelier", @@ -124,42 +124,44 @@ "Automatic": "Automatisk", "Connect to Parousia Desktop to see and change these.": "Anslut till Parousia Desktop för att se och ändra dessa.", "Allow userscripts": "Tillåt användarskript", - "Any web page can connect while this is on. Userscripts can only publish presence, never read status or change settings.": "Vilken webbsida som helst kan ansluta när detta är på. Användarskript kan bara publicera närvaro, aldrig läsa status eller ändra inställningar.", - "Parousia Desktop couldn't confirm this connection is yours, so these can't be changed from here. Use the Parousia-Desktop set command or Desktop's own console instead.": "Parousia Desktop kunde inte bekräfta att den här anslutningen är din, så dessa inställningar kan inte ändras härifrån. Använd kommandot Parousia-Desktop set eller Desktops egna konsol istället.", + "Any web page can connect while this is on. Userscripts can only send presence, not read status or change settings.": "Så länge det är på kan vilken webbsida som helst ansluta. Userscripts kan bara skicka närvaro, inte läsa status eller ändra inställningar.", + "Parousia Desktop couldn't confirm this connection is yours, so you can't change these here. Use the Parousia-Desktop set command or Desktop's console instead.": "Parousia Desktop kunde inte bekräfta att den här anslutningen är din, så du kan inte ändra dessa här. Använd kommandot Parousia-Desktop set eller Desktops konsol i stället.", "Language": "Språk", - "Changing it reloads any open Parousia page.": "Om du ändrar det läses alla öppna Parousia-sidor om.", + "Open Parousia pages reload when you change it.": "Öppna Parousia-sidor laddas om när du ändrar det.", "Parousia Desktop": "Parousia Desktop", - "Share Media Details": "Dela medieinformation", - "Include what you're watching or reading, not just the site's name.": "Inkludera vad du tittar på eller läser, inte bara webbplatsens namn.", + "Share media details": "Dela medieinformation", + "Include what you're watching or reading, not only the site's name.": "Inkludera vad du tittar på eller läser, inte bara webbplatsens namn.", + "Show media presence": "Visa medienärvaro", + "Keep showing music and video activity when switching to websites without an enabled Activity.": "Fortsätt visa musik och video när du byter till webbplatser utan någon aktiverad aktivitet.", "Shorter": "Kortare", "Longer": "Längre", "Pause activity": "Pausa aktivitet", "Share as usual": "Dela som vanligt", - "Incognito Behaviour": "Beteende i inkognitoläge", - "What to do in private windows, if you've allowed Parousia there.": "Vad som ska göras i privata fönster, om du har tillåtit Parousia där.", + "Private windows": "Privata fönster", + "What to do in private windows you've allowed Parousia in.": "Vad som ska hända i privata fönster där du tillåtit Parousia.", "What leaves your browser": "Vad som lämnar din webbläsare", - "Idle Timeout": "Tidsgräns för inaktivitet", - "Keep sharing this long after you switch away from the browser. Sound playing keeps it going.": "Fortsätt dela så här länge efter att du växlat från webbläsaren. Ljuduppspelning håller det igång.", + "Idle timeout": "Tidsgräns för inaktivitet", + "Keep sharing this long after you leave the browser. Sound keeps it going.": "Fortsätt dela så här länge efter att du lämnat webbläsaren. Ljud som spelas upp håller det igång.", "What Activities may read": "Vad aktiviteter får läsa", - "On sites you've granted, Activities that read pages may take these. Switched off, Parousia doesn't read them, and doesn't show what an Activity's own code read.": "På webbplatser du har godkänt kan aktiviteter som läser sidor hämta dessa. Om det är avstängt läser Parousia dem inte och visar inte heller vad en aktivitets egen kod läste.", + "On sites you've allowed, Activities that read pages may use these. When switched off, Parousia reads none of them and shows no page data from Activities.": "På webbplatser du tillåtit får aktiviteter som läser sidor använda dessa. När det är avstängt läser Parousia inget av dem och visar inga siddata från aktiviteter.", "{name} Rich Presence": "{name} Rich Presence", - "Show your activity on {name}.": "Visa din aktivitet på {name}.", - "Parousia Desktop shows your activity on these apps. Discord works now. Fluxer doesn't yet let other apps show activity on your profile, and Stoat is still being built, so those choices are saved for when they arrive.": "Parousia Desktop visar din aktivitet i dessa appar. Discord fungerar nu. Fluxer tillåter ännu inte andra appar att visa aktivitet på din profil, och Stoat byggs fortfarande, så de valen sparas tills de är tillgängliga.", + "Show your presence on {name}.": "Visa din närvaro på {name}.", + "Parousia Desktop shows your presence on these apps. Discord works now. Fluxer doesn't let other apps show presence yet, and Stoat is still being built. Choices for them are saved until they arrive.": "Parousia Desktop visar din närvaro i dessa appar. Discord fungerar redan. Fluxer tillåter ännu inte andra appar att visa närvaro, och Stoat är fortfarande under utveckling. Dina val för dem sparas tills de är klara.", "Discord-RPC-Extension": "Discord-RPC-Extension", - "Show Discord presence through Discord-RPC-Extension's app (discord_rpc_ext) on this computer, when it's running. Rich Presence only: nothing else is sent to it or accepted from it.": "Visa Discord-närvaro via Discord-RPC-Extensions app (discord_rpc_ext) på den här datorn när den körs. Endast Rich Presence: inget annat skickas till den eller godkänns från den.", + "Use Discord-RPC-Extension's app (discord_rpc_ext) on this computer when it's running. Only Rich Presence is sent to it or accepted from it.": "Använd Discord-RPC-Extensions app (discord_rpc_ext) på den här datorn när den körs. Endast Rich Presence skickas till den eller tas emot från den.", "Presence platforms": "Närvaroplattformar", "Discord without Parousia Desktop": "Discord utan Parousia Desktop", "Other extensions": "Andra tillägg", - "Show what MAL-Sync recognizes on anime and manga sites as your activity there, in place of the site's own. Parousia asks the MAL-Sync extension about the tab you're on and takes only Rich Presence from it. Turn off MAL-Sync's own Discord Rich Presence setting so it isn't shown twice.": "Visa vad MAL-Sync identifierar på anime- och mangawebbplatser som din aktivitet där, istället för webbplatsens egna. Parousia frågar MAL-Sync-tillägget om fliken du är på och hämtar endast Rich Presence från det. Stäng av MAL-Syncs egna inställning för Discord Rich Presence så att det inte visas dubbelt.", + "Show what MAL-Sync recognizes on anime and manga sites in place of the site's own. Parousia takes only Rich Presence from MAL-Sync. Turn off MAL-Sync's Discord Rich Presence setting so it isn't shown twice.": "Visa det MAL-Sync känner igen på anime- och mangasidor i stället för sajtens egen. Parousia tar bara Rich Presence från MAL-Sync. Stäng av MAL-Syncs inställning för Discord Rich Presence så att den inte visas två gånger.", "Parousia Desktop: {status}": "Parousia Desktop: {status}", "Off while Discord Rich Presence is off": "Av medan Discord Rich Presence är avstängt", "Standing by while Parousia Desktop shows Discord": "I vänteläge medan Parousia Desktop visar Discord", - "Access your data for all websites": "Få åtkomst till dina data för alla webbplatser", - "Off by default. With it on, Activities that read pages can read any site, without asking site by site. Parousia never turns it on by itself.": "Avstängt som standard. När det är påslaget kan aktiviteter som läser sidor läsa vilken webbplats som helst utan att fråga från plats till plats. Parousia slår aldrig på detta själv.", + "Allow access to all websites": "Tillåt åtkomst till alla webbplatser", + "Off by default. With it on, Activities that read pages can read any site without asking for each one. Parousia never turns it on by itself.": "Avstängt som standard. När det är på kan aktiviteter som läser sidor läsa vilken webbplats som helst utan att fråga för varje. Parousia slår aldrig på det av sig själv.", "All websites": "Alla webbplatser", - "Otherwise your browser asks before an Activity reads a site, when you turn the Activity on. Sites you allowed are managed in your browser's settings for this extension.": "Annars frågar din webbläsare innan en aktivitet läser en webbplats när du slår på aktiviteten. Webbplatser du har tillåtit hanteras i din webbläsares inställningar för detta tillägg.", + "Otherwise, your browser asks before an Activity reads a site, when you turn the Activity on. Manage the sites you've allowed in your browser's settings for this extension.": "I annat fall frågar webbläsaren innan en aktivitet läser en webbplats, när du slår på aktiviteten. Hantera webbplatser du tillåtit i webbläsarens inställningar för tillägget.", "Change in the dashboard": "Ändra i kontrollpanelen", - "Your browser asks before granting access, which it does from the dashboard.": "Din webbläsare frågar innan den beviljar åtkomst, vilket görs från kontrollpanelen.", + "Your browser asks for access from the dashboard.": "Webbläsaren frågar efter åtkomst från instrumentpanelen.", "Coming soon": "Kommer snart", "Link accounts such as Jena Cloud to share presence without Parousia Desktop.": "Länka konton som Jena Cloud för att dela närvaro utan Parousia Desktop.", "Extension": "Tillägg", @@ -187,9 +189,9 @@ "Versions don't match": "Versionerna stämmer inte överens", "This extension and Parousia Desktop are different major versions. Update whichever is older.": "Det här tillägget och Parousia Desktop har olika huvudversioner. Uppdatera den som är äldre.", "Parousia Desktop couldn't be found": "Parousia Desktop kunde inte hittas", - "Launch Parousia Desktop to share your browser activity.": "Starta Parousia Desktop för att dela din webbläsaraktivitet.", + "Launch Parousia Desktop to share your presence.": "Starta Parousia Desktop för att dela din närvaro.", "Showing {activity}": "Visar {activity}", - "Showing your activity": "Visar din aktivitet", + "Showing your presence": "Visar din närvaro", "Ready": "Klar", "Connecting…": "Ansluter…", "Not running": "Körs inte", @@ -197,21 +199,21 @@ "Refused": "Nekad", "Connected, v{version}": "Ansluten, v{version}", "Looking for it…": "Söker…", - "No activity detected": "Ingen aktivitet upptäcktes", - "Browse a supported site and it shows up here.": "Besök en webbplats som stöds så visas den här.", + "No Activity detected": "Ingen aktivitet upptäckt", + "Visit a supported site and it appears here.": "Besök en webbplats som stöds så visas den här.", "Sharing {name}": "Delar {name}", "Sharing now": "Delar nu", "{time} elapsed": "{time} har gått", "Update Parousia Desktop": "Uppdatera Parousia Desktop", "Get Parousia Desktop": "Hämta Parousia Desktop", "Checking…": "Kontrollerar…", - "Retry Connection": "Försök ansluta igen", - "Discord-RPC-Extension is running, so Discord can still show your activity without Parousia Desktop.": "Discord-RPC-Extension körs, så Discord kan fortfarande visa din aktivitet utan Parousia Desktop.", + "Retry connection": "Försök ansluta igen", + "Discord-RPC-Extension is running, so Discord can still show your presence without Parousia Desktop.": "Discord-RPC-Extension körs, så Discord kan fortfarande visa din närvaro utan Parousia Desktop.", "Parousia": "Parousia", "PAROUSIA": "PAROUSIA", "Settings": "Inställningar", - "Current activity": "Nuvarande aktivitet", - "Configure activity": "Konfigurera aktivitet", + "Now sharing": "Delas nu", + "Configure Activity": "Konfigurera aktivitet", "PreMiD": "PreMiD", "Preferences": "Inställningar", "Changes apply right away.": "Ändringarna tillämpas direkt.", @@ -235,17 +237,17 @@ "PreMiD Activities": "PreMiD-aktiviteter", "Clear filters": "Rensa filter", "Enable or disable all…": "Aktivera eller inaktivera alla…", - "Nothing matches that search and those filters.": "Inget matchar den sökningen och de filtren.", + "Nothing matches your search and filters.": "Inget matchar din sökning och dina filter.", "No Activities in this build yet": "Inga aktiviteter i den här versionen än", - "Until one is added, Parousia recognizes no sites, so nothing about your browsing is shared.": "Tills en läggs till känner Parousia inte igen några webbplatser, så inget om ditt surfande delas.", + "Until one is added, Parousia recognizes no sites and shares nothing from your browsing.": "Tills en läggs till känner Parousia inte igen några webbplatser och delar inget från din surfning.", "All Activities": "Alla aktiviteter", "Implementation": "Implementering", - "Both Parousia and PreMiD have an Activity for this website. Only the one chosen runs.": "Både Parousia och PreMiD har en aktivitet för den här webbplatsen. Endast den valda körs.", + "Parousia and PreMiD both have an Activity for this website. Only the one you choose runs.": "Både Parousia och PreMiD har en aktivitet för den här webbplatsen. Endast den du väljer körs.", "This Activity isn't in this build": "Den här aktiviteten finns inte i den här versionen", "It may have been removed, or come from another version of Parousia.": "Den kan ha tagits bort eller komma från en annan version av Parousia.", - "What to share when the tab you're on has no Activity. Privacy settings and Settings > Platforms apply to it, as to any Activity.": "Vad som ska delas när fliken du är på saknar aktivitet. Integritetsinställningar och Inställningar > Plattformar gäller för den, precis som för alla aktiviteter.", + "What to share when the tab has no Activity. Privacy settings and Settings > Platforms apply to it, as they do to any Activity.": "Vad som ska delas när fliken saknar aktivitet. Integritetsinställningar och Inställningar > Plattformar gäller för den, precis som för alla aktiviteter.", "Preview": "Förhandsgranskning", - "How Parousia behaves in this browser, and Parousia Desktop's own settings.": "Hur Parousia fungerar i den här webbläsaren, och Parousia Desktops egna inställningar.", + "How Parousia behaves in this browser, and Parousia Desktop's settings.": "Hur Parousia fungerar i den här webbläsaren, och Parousia Desktops egna inställningar.", "Dashboard": "Kontrollpanel", "Search Activities or sites": "Sök aktiviteter eller webbplatser", "Filter Activities": "Filtrera aktiviteter", @@ -253,24 +255,24 @@ "Activity pages": "Aktivitetssidor", "Settings categories": "Inställningskategorier", "A newer Parousia Desktop is available": "En nyare version av Parousia Desktop finns tillgänglig", - "This extension is newer than Parousia Desktop {version}. They still work together; update Desktop to get everything the extension offers.": "Det här tillägget är nyare än Parousia Desktop {version}. De fungerar fortfarande tillsammans; uppdatera Desktop för att få allt som tillägget erbjuder.", + "This extension is newer than Parousia Desktop {version}. They still work together. Update Desktop to get everything the extension offers.": "Det här tillägget är nyare än Parousia Desktop {version}. De fungerar fortfarande tillsammans; uppdatera Desktop för att få allt som tillägget erbjuder.", "A newer Parousia extension is available": "Ett nyare Parousia-tillägg finns tillgängligt", - "Parousia Desktop {version} is newer than this extension. They still work together; update the extension from your browser's extension page.": "Parousia Desktop {version} är nyare än det här tillägget. De fungerar fortfarande tillsammans; uppdatera tillägget från din webbläsares tilläggssida.", + "Parousia Desktop {version} is newer than this extension. They still work together. Update the extension from your browser's extension page.": "Parousia Desktop {version} är nyare än det här tillägget. De fungerar fortfarande tillsammans; uppdatera tillägget från din webbläsares tilläggssida.", "Not now": "Inte nu", "{n} Activities": { "one": "{n} aktivitet", "other": "{n} aktiviteter" }, - "Enabled {count}. {n} Activities stayed off because their sites weren't granted.": { - "one": "Aktiverade: {count}. {n} aktivitet förblev avstängd eftersom dess webbplatser inte godkändes.", - "other": "Aktiverade: {count}. {n} aktiviteter förblev avstängda eftersom deras webbplatser inte godkändes." + "Enabled {count}. {n} Activities stayed off because access to their sites was declined.": { + "one": "Aktiverade: {count}. {n} aktivitet förblev avstängd eftersom åtkomsten till dess webbplatser nekades.", + "other": "Aktiverade: {count}. {n} aktiviteter förblev avstängda eftersom åtkomsten till deras webbplatser nekades." }, "{n} Activities read pages.": { "one": "{n} aktivitet läser sidor.", "other": "{n} aktiviteter läser sidor." }, - "Your browser will ask for access to {n} sites in one prompt, which can be long. Anything you decline stays off.": { - "one": "Din webbläsare kommer att be om åtkomst till {n} webbplats i en enda fråga, vilket kan bli långt. Allt du nekar förblir avstängt.", - "other": "Din webbläsare kommer att be om åtkomst till {n} webbplatser i en enda fråga, vilket kan bli långt. Allt du nekar förblir avstängt." + "Your browser asks for access to {n} sites in one prompt. Anything you decline stays off.": { + "one": "Din webbläsare frågar efter åtkomst till {n} webbplats i en enda fråga. Allt du nekar förblir avstängt.", + "other": "Din webbläsare frågar efter åtkomst till {n} webbplatser i en enda fråga. Allt du nekar förblir avstängt." } } diff --git a/browser/src/locales/zh.json b/browser/src/locales/zh.json index 1a3e353..6329096 100644 --- a/browser/src/locales/zh.json +++ b/browser/src/locales/zh.json @@ -2,23 +2,23 @@ "Off": "关", "1 h": "1 小时", "{n} min": "{n} 分钟", - "Give it a name of at least 2 characters.": "请为它起一个至少 2 个字符的名称。", - "Discord leaves out lines under 2 characters.": "Discord 会忽略少于 2 个字符的行。", - "Use an https image link, or an asset name from your own Discord Application.": "请使用 https 图片链接,或你自己的 Discord 应用中的素材名称。", + "Use a name of at least 2 characters.": "名称至少需要 2 个字符。", + "Discord drops lines shorter than 2 characters.": "Discord 会忽略少于 2 个字符的行。", + "Use an https image link, or an asset name from your Discord application.": "填写 https 图片链接,或你的 Discord 应用中的素材名称。", "A button needs both a label and a link.": "按钮需要同时有文字和链接。", - "Button links start with https:// or http://.": "按钮链接须以 https:// 或 http:// 开头。", - "A Discord Application ID is 17 to 20 digits.": "Discord 应用 ID 由 17 到 20 位数字组成。", - "{name} is on. Nothing to share on this page yet.": "{name} 已开启。此页面暂无可分享的内容。", - "Nothing to share on this page.": "此页面没有可分享的内容。", - "Your browser didn't allow access to its sites, so it stays off.": "浏览器未允许访问其网站,因此仍保持关闭。", - "An Activity for this site, turned off. Turning it on asks your browser for access to {sites}.": "此网站有对应的活动,但已关闭。开启时会请求浏览器允许访问 {sites}。", - "An Activity for this site, turned off.": "此网站有对应的活动,但已关闭。", + "Button links must start with https:// or http://.": "按钮链接必须以 https:// 或 http:// 开头。", + "A Discord application ID is 17 to 20 digits.": "Discord 应用 ID 为 17 到 20 位数字。", + "{name} is on. Nothing to share here yet.": "{name} 已开启。此处暂无可分享的内容。", + "Nothing to share here.": "此处没有可分享的内容。", + "Your browser declined access to its sites, so it stays off.": "浏览器拒绝了对其网站的访问,因此它保持关闭。", + "There's an Activity for this site, and it's off. Turning it on asks your browser for access to {sites}.": "此网站有一个活动,目前已关闭。开启它时,浏览器会请求访问 {sites}。", + "There's an Activity for this site, and it's off.": "此网站有一个活动,目前已关闭。", "Turn on": "开启", - "Your browser didn't allow access to {sites}, so it still can't run here.": "浏览器未允许访问 {sites},因此它仍无法在此运行。", - "It's on, but your browser hasn't given it access to {sites}, so it can't run here.": "它已开启,但浏览器尚未允许它访问 {sites},因此无法在此运行。", + "Your browser declined access to {sites}, so it still can't run here.": "浏览器拒绝了对 {sites} 的访问,因此它仍无法在此运行。", + "It's on, but it has no access to {sites}, so it can't run here.": "已开启,但没有访问 {sites} 的权限,因此无法在此运行。", "Allow access": "允许访问", - "Show a Default Activity": "显示默认活动", - "Shared whenever the tab you're on has no Activity: a site none covers, a browser page, a new tab.": "当前标签页没有活动时分享:没有活动支持的网站、浏览器页面、新标签页。", + "Turn on the Default Activity": "开启默认活动", + "Shared when the tab has no Activity: a site none covers, a browser page, or a new tab.": "当标签页没有活动时分享:没有活动覆盖的网站、浏览器页面或新标签页。", "Name": "名称", "Shown as what you're doing, like \"Playing \". Required.": "显示为你正在做的事,例如“正在玩 <名称>”。必填。", "Details": "详情", @@ -26,20 +26,20 @@ "State": "状态", "The second line.": "第二行。", "Large image": "大图", - "An https image link, or an asset name from your own Discord Application.": "https 图片链接,或你自己的 Discord 应用中的素材名称。", + "An https image link, or an asset name from your Discord application.": "https 图片链接,或你的 Discord 应用中的素材名称。", "Large image text": "大图文字", - "Shown when someone hovers over it.": "他人将鼠标悬停在其上时显示。", + "Shown on hover.": "鼠标悬停时显示。", "Small image": "小图", "Shown in the large image's corner.": "显示在大图的角落。", "Small image text": "小图文字", - "Discord Application ID": "Discord 应用 ID", - "Optional: show it as your own Discord Application instead of Parousia.": "可选:以你自己的 Discord 应用而不是 Parousia 的身份显示。", + "Discord application ID": "Discord 应用 ID", + "Optional. Show it as your own Discord application instead of Parousia.": "可选。以你自己的 Discord 应用显示,而不是 Parousia。", "Button {n}": "按钮 {n}", "Its label.": "按钮上的文字。", "Button {n} link": "按钮 {n} 链接", "Where it goes.": "点击后前往的地址。", "Show elapsed time": "显示已用时间", - "How long it's been shown, counted from when it started.": "从开始时计算,显示已持续的时间。", + "Counts up from when it started.": "从开始显示时计时。", "Text": "文字", "Images": "图片", "Buttons": "按钮", @@ -48,19 +48,19 @@ "Fix what's marked, then turn it on.": "请先修正标出的问题,再开启。", "On.": "已开启。", "Off.": "已关闭。", - "Not saved: fix what's marked.": "未保存:请修正标出的问题。", - "Saved. It's shown when no Activity is.": "已保存。没有活动时会显示它。", + "Not saved. Fix the marked fields.": "未保存。请修正标记的字段。", + "Saved. It shows when no Activity has anything to share.": "已保存。当没有活动可分享内容时显示。", "Saved. Turn it on above to share it.": "已保存。请在上方开启以进行分享。", "Default Activity": "默认活动", "{first} and {second}": "{first} 和 {second}", "{first}, {second}, and {n} more": "{first}、{second} 及另外 {n} 个", - "Reads only the address and title of its pages, so it needs no site access.": "仅读取页面的地址和标题,因此无需访问网站。", - "Its own code reads its pages. Turning it on asks your browser for access to {sites}.": "由它自己的代码读取其页面。开启时会请求浏览器允许访问 {sites}。", - "Parousia reads what's playing on its pages. Turning it on asks your browser for access to {sites}.": "由 Parousia 读取其页面上正在播放的内容。开启时会请求浏览器允许访问 {sites}。", + "Reads only page addresses and titles, so it needs no site access.": "只读取页面地址和标题,因此无需网站访问权限。", + "Its code reads the pages it runs on. Turning it on asks your browser for access to {sites}.": "其代码读取它运行的页面。开启时,浏览器会请求访问 {sites}。", + "Parousia reads what's playing on those pages. Turning it on asks your browser for access to {sites}.": "Parousia 会读取这些页面上正在播放的内容。开启时,浏览器会请求访问 {sites}。", "Show this Activity": "显示此活动", - "It stays off: your browser didn't allow access to {sites}.": "它仍保持关闭:浏览器未允许访问 {sites}。", - "Your browser didn't allow access to {sites}, so it still doesn't run there.": "浏览器未允许访问 {sites},因此它仍不会在那里运行。", - "It's on, but can't read {sites}, so it doesn't run there. Access was declined or taken back.": "它已开启,但无法读取 {sites},因此不会在那里运行。访问已被拒绝或收回。", + "It stays off: your browser declined access to {sites}.": "保持关闭:浏览器拒绝了对 {sites} 的访问。", + "Your browser declined access to {sites}, so it still doesn't run there.": "浏览器拒绝了对 {sites} 的访问,因此它仍无法在那里运行。", + "It's on, but can't read {sites}, so it doesn't run there. Access was declined or revoked.": "已开启,但无法读取 {sites},因此不会在那里运行。访问权限被拒绝或已撤销。", "PreMiD: {name}": "PreMiD:{name}", "Sites": "网站", "From": "来源", @@ -68,24 +68,24 @@ "Activity": "活动", "Needs access": "需要访问权限", "Access declined": "访问被拒绝", - "multi": "多个", + "2 sources": "2 个来源", "Show {name}": "显示 {name}", "Filter, {n} selected": "筛选,已选 {n} 项", "Filter": "筛选", "Enabled {count}.": "已启用{count}。", - "Nothing was enabled: your browser didn't grant access to their sites.": "没有启用任何活动:浏览器未允许访问它们的网站。", + "Nothing was enabled. Your browser declined access to their sites.": "没有开启任何项目。浏览器拒绝了对它们网站的访问。", "Couldn't change the Activities. Try again.": "无法更改活动。请重试。", "Nothing was on.": "没有已开启的活动。", "Disabled {count}.": "已停用{count}。", - "No Activities match, so there is nothing to change.": "没有匹配的活动,无需更改。", - "This applies to the {count} matching your search and filters, on every page.": "适用于所有页面上符合搜索和筛选条件的{count}。", + "No Activities match, so there's nothing to change.": "没有匹配的活动,因此没有可更改的内容。", + "This applies to all {count} matching your search and filters, not only this page.": "这将应用于所有符合搜索和筛选条件的 {count} 个活动,而不仅是本页。", "Enable {count}?": "启用{count}?", - "None of them needs access to a new site, so your browser won't ask for anything.": "它们都不需要访问新网站,因此浏览器不会提出任何请求。", + "None needs access to a new site, so your browser won't ask.": "没有一个需要访问新网站,因此浏览器不会询问。", "Cancel": "取消", "Enable {count}": "启用{count}", "Disable {count}": "停用{count}", "Disable {count}?": "停用{count}?", - "Sites only they used are given back to your browser.": "仅它们使用过的网站权限将交还给浏览器。", + "Sites only they use are given back to your browser.": "仅它们使用的网站权限将交还给浏览器。", "Enable all ({n})": "全部启用({n})", "Disable all ({n})": "全部停用({n})", "{first}–{last} of {total}": "第 {first}–{last} 项,共 {total} 项", @@ -100,7 +100,7 @@ "Appearance": "外观", "Theme": "主题", "Privacy": "隐私", - "What's shared, what Activities read, incognito": "分享的内容、活动读取的内容、无痕模式", + "What's shared, what Activities read, private windows": "分享的内容、活动读取的内容、隐私窗口", "Site access": "网站访问", "Access to all websites": "访问所有网站", "Platforms": "平台", @@ -112,7 +112,7 @@ "What's playing": "正在播放的内容", "Titles, artists, and progress of what you're watching or listening to.": "你正在观看或收听内容的标题、艺术家和进度。", "Thumbnails": "缩略图", - "Images of what you're watching or reading, such as a video's thumbnail or an album cover.": "你正在观看或阅读内容的图片,例如视频缩略图或专辑封面。", + "Images of what you're watching or reading, like a video thumbnail or album cover.": "你正在观看或阅读内容的图片,例如视频缩略图或专辑封面。", "Creator icons": "创作者头像", "Pictures of the channel, artist, or creator.": "频道、艺术家或创作者的图片。", "Atelier": "Atelier", @@ -124,42 +124,44 @@ "Automatic": "自动", "Connect to Parousia Desktop to see and change these.": "连接到 Parousia Desktop 后即可查看和更改这些设置。", "Allow userscripts": "允许用户脚本", - "Any web page can connect while this is on. Userscripts can only publish presence, never read status or change settings.": "开启后,任何网页都可以连接。用户脚本只能发布状态,无法读取状态或更改设置。", - "Parousia Desktop couldn't confirm this connection is yours, so these can't be changed from here. Use the Parousia-Desktop set command or Desktop's own console instead.": "Parousia Desktop 无法确认此连接属于你,因此无法在此更改这些设置。请改用 Parousia-Desktop set 命令或 Desktop 自带的控制台。", + "Any web page can connect while this is on. Userscripts can only send presence, not read status or change settings.": "开启期间,任何网页都可以连接。用户脚本只能发送状态,不能读取状态或更改设置。", + "Parousia Desktop couldn't confirm this connection is yours, so you can't change these here. Use the Parousia-Desktop set command or Desktop's console instead.": "Parousia Desktop 无法确认此连接属于你,因此无法在此更改。请改用 Parousia-Desktop set 命令或 Desktop 的控制台。", "Language": "语言", - "Changing it reloads any open Parousia page.": "更改语言会重新加载所有已打开的 Parousia 页面。", + "Open Parousia pages reload when you change it.": "更改后,已打开的 Parousia 页面会重新加载。", "Parousia Desktop": "Parousia Desktop", - "Share Media Details": "分享媒体详情", - "Include what you're watching or reading, not just the site's name.": "包含你正在观看或阅读的内容,而不只是网站名称。", + "Share media details": "分享媒体详情", + "Include what you're watching or reading, not only the site's name.": "包含你正在观看或阅读的内容,而不只是网站名称。", + "Show media presence": "显示媒体状态", + "Keep showing music and video activity when switching to websites without an enabled Activity.": "切换到没有已启用活动的网站时,继续显示音乐和视频活动。", "Shorter": "缩短", "Longer": "延长", "Pause activity": "暂停活动", "Share as usual": "照常分享", - "Incognito Behaviour": "无痕模式下的行为", - "What to do in private windows, if you've allowed Parousia there.": "在你已允许 Parousia 运行的隐私窗口中如何处理。", + "Private windows": "隐私窗口", + "What to do in private windows you've allowed Parousia in.": "在你允许 Parousia 运行的隐私窗口中的行为。", "What leaves your browser": "离开浏览器的内容", - "Idle Timeout": "空闲超时", - "Keep sharing this long after you switch away from the browser. Sound playing keeps it going.": "切换离开浏览器后,继续分享这么长时间。若有声音在播放,则会一直分享。", + "Idle timeout": "空闲超时", + "Keep sharing this long after you leave the browser. Sound keeps it going.": "离开浏览器后,继续分享这么长时间。正在播放的声音会让分享持续。", "What Activities may read": "活动可以读取的内容", - "On sites you've granted, Activities that read pages may take these. Switched off, Parousia doesn't read them, and doesn't show what an Activity's own code read.": "在你已授权的网站上,读取页面的活动可以获取这些内容。关闭后,Parousia 不会读取它们,也不会显示活动自身代码所读取的内容。", + "On sites you've allowed, Activities that read pages may use these. When switched off, Parousia reads none of them and shows no page data from Activities.": "在你允许的网站上,读取页面的活动可以使用这些数据。关闭时,Parousia 不读取任何这些数据,也不显示活动的页面数据。", "{name} Rich Presence": "{name} Rich Presence", - "Show your activity on {name}.": "在 {name} 上显示你的活动。", - "Parousia Desktop shows your activity on these apps. Discord works now. Fluxer doesn't yet let other apps show activity on your profile, and Stoat is still being built, so those choices are saved for when they arrive.": "Parousia Desktop 会在这些应用上显示你的活动。Discord 现已可用。Fluxer 尚不允许其他应用在你的个人资料上显示活动,Stoat 仍在开发中,因此这些选择会先保存起来,等它们就绪后生效。", + "Show your presence on {name}.": "在 {name} 上显示你的状态。", + "Parousia Desktop shows your presence on these apps. Discord works now. Fluxer doesn't let other apps show presence yet, and Stoat is still being built. Choices for them are saved until they arrive.": "Parousia Desktop 会在这些应用中显示你的状态。Discord 已可用。Fluxer 尚不允许其他应用显示状态,Stoat 仍在开发中。在它们推出之前,为它们所做的选择会被保存。", "Discord-RPC-Extension": "Discord-RPC-Extension", - "Show Discord presence through Discord-RPC-Extension's app (discord_rpc_ext) on this computer, when it's running. Rich Presence only: nothing else is sent to it or accepted from it.": "当这台电脑上的 Discord-RPC-Extension 应用(discord_rpc_ext)运行时,通过它显示 Discord 状态。仅限 Rich Presence:不会向它发送其他内容,也不接受它发来的任何内容。", + "Use Discord-RPC-Extension's app (discord_rpc_ext) on this computer when it's running. Only Rich Presence is sent to it or accepted from it.": "运行时使用本机上的 Discord-RPC-Extension 应用(discord_rpc_ext)。只向它发送或接受 Rich Presence。", "Presence platforms": "状态平台", "Discord without Parousia Desktop": "不使用 Parousia Desktop 的 Discord", "Other extensions": "其他扩展", - "Show what MAL-Sync recognizes on anime and manga sites as your activity there, in place of the site's own. Parousia asks the MAL-Sync extension about the tab you're on and takes only Rich Presence from it. Turn off MAL-Sync's own Discord Rich Presence setting so it isn't shown twice.": "在动漫和漫画网站上,用 MAL-Sync 识别到的内容作为你的活动,取代网站自身的活动。Parousia 会就当前标签页询问 MAL-Sync 扩展,并只接收其中的 Rich Presence。请关闭 MAL-Sync 自带的 Discord Rich Presence 设置,以免重复显示。", + "Show what MAL-Sync recognizes on anime and manga sites in place of the site's own. Parousia takes only Rich Presence from MAL-Sync. Turn off MAL-Sync's Discord Rich Presence setting so it isn't shown twice.": "在动漫和漫画网站上,用 MAL-Sync 识别的内容代替网站自身的显示。Parousia 只从 MAL-Sync 获取 Rich Presence。请关闭 MAL-Sync 的 Discord Rich Presence 设置,以免重复显示。", "Parousia Desktop: {status}": "Parousia Desktop:{status}", "Off while Discord Rich Presence is off": "Discord Rich Presence 关闭时此项也关闭", "Standing by while Parousia Desktop shows Discord": "Parousia Desktop 正在显示 Discord,此项待命中", - "Access your data for all websites": "访问你在所有网站上的数据", - "Off by default. With it on, Activities that read pages can read any site, without asking site by site. Parousia never turns it on by itself.": "默认关闭。开启后,读取页面的活动可以读取任何网站,无需逐个网站询问。Parousia 绝不会自行开启它。", + "Allow access to all websites": "允许访问所有网站", + "Off by default. With it on, Activities that read pages can read any site without asking for each one. Parousia never turns it on by itself.": "默认关闭。开启后,读取页面的活动可以读取任何网站,无需逐个询问。Parousia 绝不会自行开启此项。", "All websites": "所有网站", - "Otherwise your browser asks before an Activity reads a site, when you turn the Activity on. Sites you allowed are managed in your browser's settings for this extension.": "否则,在你开启某个活动时,浏览器会在该活动读取网站之前询问。你允许的网站可在浏览器中此扩展程序的设置里管理。", + "Otherwise, your browser asks before an Activity reads a site, when you turn the Activity on. Manage the sites you've allowed in your browser's settings for this extension.": "否则,在你开启某个活动时,浏览器会在该活动读取网站前询问。已允许的网站可在浏览器中此扩展的设置里管理。", "Change in the dashboard": "在控制面板中更改", - "Your browser asks before granting access, which it does from the dashboard.": "浏览器会在授予访问权限前询问,而这一步由控制面板发起。", + "Your browser asks for access from the dashboard.": "浏览器会从仪表板请求访问权限。", "Coming soon": "即将推出", "Link accounts such as Jena Cloud to share presence without Parousia Desktop.": "关联 Jena Cloud 等账号,即可在没有 Parousia Desktop 的情况下分享状态。", "Extension": "扩展程序", @@ -187,9 +189,9 @@ "Versions don't match": "版本不匹配", "This extension and Parousia Desktop are different major versions. Update whichever is older.": "此扩展程序与 Parousia Desktop 的主版本不同。请更新较旧的一方。", "Parousia Desktop couldn't be found": "找不到 Parousia Desktop", - "Launch Parousia Desktop to share your browser activity.": "启动 Parousia Desktop 以分享你的浏览器活动。", + "Launch Parousia Desktop to share your presence.": "启动 Parousia Desktop 以分享你的状态。", "Showing {activity}": "正在显示 {activity}", - "Showing your activity": "正在显示你的活动", + "Showing your presence": "正在显示你的状态", "Ready": "就绪", "Connecting…": "连接中…", "Not running": "未运行", @@ -197,21 +199,21 @@ "Refused": "已拒绝", "Connected, v{version}": "已连接,v{version}", "Looking for it…": "正在查找…", - "No activity detected": "未检测到活动", - "Browse a supported site and it shows up here.": "浏览受支持的网站后,活动会显示在这里。", + "No Activity detected": "未检测到活动", + "Visit a supported site and it appears here.": "访问受支持的网站,它就会显示在这里。", "Sharing {name}": "正在分享 {name}", "Sharing now": "正在分享", "{time} elapsed": "已用时 {time}", "Update Parousia Desktop": "更新 Parousia Desktop", "Get Parousia Desktop": "获取 Parousia Desktop", "Checking…": "检查中…", - "Retry Connection": "重试连接", - "Discord-RPC-Extension is running, so Discord can still show your activity without Parousia Desktop.": "Discord-RPC-Extension 正在运行,因此即使没有 Parousia Desktop,Discord 仍可显示你的活动。", + "Retry connection": "重试连接", + "Discord-RPC-Extension is running, so Discord can still show your presence without Parousia Desktop.": "Discord-RPC-Extension 正在运行,因此无需 Parousia Desktop,Discord 也能显示你的状态。", "Parousia": "Parousia", "PAROUSIA": "PAROUSIA", "Settings": "设置", - "Current activity": "当前活动", - "Configure activity": "配置活动", + "Now sharing": "正在分享", + "Configure Activity": "配置活动", "PreMiD": "PreMiD", "Preferences": "偏好设置", "Changes apply right away.": "更改会立即生效。", @@ -235,17 +237,17 @@ "PreMiD Activities": "PreMiD 活动", "Clear filters": "清除筛选", "Enable or disable all…": "全部启用或停用…", - "Nothing matches that search and those filters.": "没有符合该搜索和筛选条件的内容。", + "Nothing matches your search and filters.": "没有符合搜索和筛选条件的内容。", "No Activities in this build yet": "此版本中暂时没有活动", - "Until one is added, Parousia recognizes no sites, so nothing about your browsing is shared.": "在添加活动之前,Parousia 不会识别任何网站,因此不会分享任何浏览信息。", + "Until one is added, Parousia recognizes no sites and shares nothing from your browsing.": "在添加活动之前,Parousia 不识别任何网站,也不分享你的浏览内容。", "All Activities": "所有活动", "Implementation": "实现方式", - "Both Parousia and PreMiD have an Activity for this website. Only the one chosen runs.": "Parousia 和 PreMiD 都为此网站提供了活动。只有选中的那一个会运行。", + "Parousia and PreMiD both have an Activity for this website. Only the one you choose runs.": "Parousia 和 PreMiD 都为此网站提供了活动。只运行你选择的那一个。", "This Activity isn't in this build": "此版本中没有这个活动", "It may have been removed, or come from another version of Parousia.": "它可能已被移除,或来自其他版本的 Parousia。", - "What to share when the tab you're on has no Activity. Privacy settings and Settings > Platforms apply to it, as to any Activity.": "当前标签页没有活动时要分享的内容。与任何活动一样,隐私设置和“设置 > 平台”同样适用于它。", + "What to share when the tab has no Activity. Privacy settings and Settings > Platforms apply to it, as they do to any Activity.": "当标签页没有活动时分享的内容。与任何活动一样,隐私设置和“设置 > 平台”同样适用于它。", "Preview": "预览", - "How Parousia behaves in this browser, and Parousia Desktop's own settings.": "Parousia 在此浏览器中的行为,以及 Parousia Desktop 自己的设置。", + "How Parousia behaves in this browser, and Parousia Desktop's settings.": "Parousia 在此浏览器中的行为,以及 Parousia Desktop 自己的设置。", "Dashboard": "控制面板", "Search Activities or sites": "搜索活动或网站", "Filter Activities": "筛选活动", @@ -253,12 +255,12 @@ "Activity pages": "活动分页", "Settings categories": "设置分类", "{n} Activities": "{n} 个活动", - "Enabled {count}. {n} Activities stayed off because their sites weren't granted.": "已启用{count}。有 {n} 个活动因网站未获允许而保持关闭。", + "Enabled {count}. {n} Activities stayed off because access to their sites was declined.": "已启用{count}。有 {n} 个活动因网站访问被拒绝而保持关闭。", "{n} Activities read pages.": "有 {n} 个活动会读取页面。", - "Your browser will ask for access to {n} sites in one prompt, which can be long. Anything you decline stays off.": "浏览器将一次性请求访问 {n} 个网站,提示内容可能很长。你拒绝的项目将保持关闭。", + "Your browser asks for access to {n} sites in one prompt. Anything you decline stays off.": "浏览器将一次性请求访问 {n} 个网站。你拒绝的项目将保持关闭。", "A newer Parousia Desktop is available": "有新版本的 Parousia Desktop 可用", - "This extension is newer than Parousia Desktop {version}. They still work together; update Desktop to get everything the extension offers.": "此扩展程序比 Parousia Desktop {version} 更新。它们仍可一起使用;请更新 Desktop 以获得扩展程序提供的全部功能。", + "This extension is newer than Parousia Desktop {version}. They still work together. Update Desktop to get everything the extension offers.": "此扩展程序比 Parousia Desktop {version} 更新。它们仍可一起使用;请更新 Desktop 以获得扩展程序提供的全部功能。", "A newer Parousia extension is available": "有新版本的 Parousia 扩展程序可用", - "Parousia Desktop {version} is newer than this extension. They still work together; update the extension from your browser's extension page.": "Parousia Desktop {version} 比此扩展程序更新。它们仍可一起使用;请在浏览器的扩展程序页面更新该扩展程序。", + "Parousia Desktop {version} is newer than this extension. They still work together. Update the extension from your browser's extension page.": "Parousia Desktop {version} 比此扩展程序更新。它们仍可一起使用;请在浏览器的扩展程序页面更新该扩展程序。", "Not now": "暂不" } diff --git a/browser/src/platforms/background.test.ts b/browser/src/platforms/background.test.ts index c08bf90..f891b04 100644 --- a/browser/src/platforms/background.test.ts +++ b/browser/src/platforms/background.test.ts @@ -6,7 +6,9 @@ import type { Presence } from "../core/presence"; import { REPORT } from "../core/test-desktop"; import { ActivityRegistry } from "../core/registry"; import { UI_PORT_NAME, type BridgeState } from "../core/ui-port"; -import type { PageBrowser } from "../activities/host"; +import type { PageBrowser, Port } from "../activities/host"; +import { registered, type ActivityManifest } from "../activities/manifest"; +import { PAGE_DATA_PORT } from "../activities/messages"; import { KEEPALIVE_MS, backgroundKeepalive, @@ -156,32 +158,64 @@ type UpdatedListener = ( tab: FakeTab, ) => void; -function installChromeMock(tab: FakeTab = { url: "https://example.com" }): { +function installChromeMock( + tab: FakeTab = { url: "https://example.com" }, + /** What `storage.local` holds, by key, and how long a read takes. */ + initial: Record = {}, + storageDelayMs = 0, + /** + * A browser that is already running: what `storage.session` holds (it outlives the background, which + * MV3 stops and starts again), the other tabs, and which tab is active. + */ + running: { + session?: Record; + others?: Record; + active?: number; + /** Tabs that have closed. */ + closed?: number[]; + } = {}, +): { connect: (name: string, senderId?: string, senderUrl?: string) => FakeUiPort; savePreferences: (value: unknown) => void; saveDefault: (value: unknown) => void; + /** Which Activities someone turned on or off, as the dashboard saves them. */ + saveStates: (value: unknown) => void; tabLookups: () => number; + /** Tab 1 unless `tabId` says another. */ update: ( change: { url?: string; title?: string; audible?: boolean; favIconUrl?: string }, next?: FakeTab, + tabId?: number, ) => void; + /** Closes a tab. */ + remove: (tabId: number) => void; + /** How long lookups of one tab take from now on, so a refresh can be overtaken while it waits on it. */ + slowTab: (tabId: number, ms: number) => void; + /** What `storage.session` holds now. */ + session: () => Record; /** Opens a tab in `windowId`, where it becomes that window's active tab. */ activate: (tabId: number, tab: FakeTab, windowId: number) => void; focus: (windowId: number) => void; /** Closes a window without saying where focus went; `focusNow` is what the browser reports after. */ close: (windowId: number, focusNow: number) => void; } { - const noop = { addListener: (): void => {} }; const activatedListeners: Array<(info: { tabId: number; windowId: number }) => void> = []; const focusListeners: Array<(windowId: number) => void> = []; const removedListeners: Array<(windowId: number) => void> = []; let lastFocused = 1; /** Tabs besides the first, and each window's active tab (window 1's is tab 1). */ - const others = new Map(); - const activeIn = new Map([[1, 1]]); + const others = new Map( + Object.entries(running.others ?? {}).map(([id, other]) => [Number(id), other]), + ); + const activeIn = new Map([[1, running.active ?? 1]]); + const sessionStore: Record = { ...running.session }; const connectListeners: Array<(port: unknown) => void> = []; const storageListeners: Array<(changes: object, area: string) => void> = []; const updatedListeners: UpdatedListener[] = []; + const stored = { ...initial }; + const removedTabListeners: Array<(tabId: number) => void> = []; + const closed = new Set(running.closed ?? []); + const slowTabs = new Map(); let current = tab; let tabLookups = 0; globalThis.chrome = { @@ -191,12 +225,23 @@ function installChromeMock(tab: FakeTab = { url: "https://example.com" }): { activatedListeners.push(listener), }, onUpdated: { addListener: (listener: UpdatedListener) => updatedListeners.push(listener) }, - onRemoved: noop, + onRemoved: { + addListener: (listener: (tabId: number) => void) => removedTabListeners.push(listener), + }, get: (async (tabId: number) => { tabLookups++; + const delay = slowTabs.get(tabId) ?? 0; + if (delay > 0) await new Promise((resolve) => setTimeout(resolve, delay)); + if (closed.has(tabId)) throw new Error(`No tab with id: ${tabId}`); return others.get(tabId) ?? current; }) as unknown as typeof chrome.tabs.get, - query: (async (query: { windowId?: number }) => { + query: (async (query: { windowId?: number; active?: boolean }) => { + // Every tab, when asked for no particular window or state (as for private tabs). + if (query.windowId === undefined && query.active === undefined) { + const every = [{ id: 1, windowId: 1, ...current }]; + for (const [id, other] of others) every.push({ id, windowId: 1, ...other }); + return every.filter((candidate) => !closed.has(candidate.id)); + } const windowId = query.windowId ?? 1; const id = activeIn.get(windowId) ?? 1; return [{ id, windowId, ...(others.get(id) ?? current) }]; @@ -213,7 +258,20 @@ function installChromeMock(tab: FakeTab = { url: "https://example.com" }): { WINDOW_ID_NONE: -1, }, storage: { - local: { get: async () => ({}), set: async () => {} }, + local: { + get: async (key: string) => { + if (storageDelayMs > 0) + await new Promise((resolve) => setTimeout(resolve, storageDelayMs)); + return key in stored ? { [key]: stored[key] } : {}; + }, + set: async () => {}, + }, + session: { + get: async (key: string) => (key in sessionStore ? { [key]: sessionStore[key] } : {}), + set: async (items: Record) => { + Object.assign(sessionStore, items); + }, + }, onChanged: { addListener: (listener: (changes: object, area: string) => void) => storageListeners.push(listener), @@ -222,6 +280,8 @@ function installChromeMock(tab: FakeTab = { url: "https://example.com" }): { runtime: { id: EXTENSION_ID, getURL: (path: string) => `chrome-extension://${EXTENSION_ID}/${path}`, + // The keepalive interval outlives a test that leaves an Activity shared. + getPlatformInfo: async () => ({ os: "linux", arch: "x64" }), onConnect: { addListener: (listener: (port: unknown) => void) => connectListeners.push(listener), }, @@ -233,6 +293,18 @@ function installChromeMock(tab: FakeTab = { url: "https://example.com" }): { storageListeners.forEach((l) => l({ preferences: { newValue: value } }, "local")), saveDefault: (value) => storageListeners.forEach((l) => l({ defaultActivity: { newValue: value } }, "local")), + saveStates: (value) => { + stored.activities = value; + storageListeners.forEach((l) => l({ activities: { newValue: value } }, "local")); + }, + session: () => ({ ...sessionStore }), + slowTab: (tabId, ms) => { + slowTabs.set(tabId, ms); + }, + remove: (tabId) => { + closed.add(tabId); + for (const listener of removedTabListeners) listener(tabId); + }, tabLookups: () => tabLookups, activate: (tabId, tab, windowId) => { others.set(tabId, tab); @@ -247,9 +319,10 @@ function installChromeMock(tab: FakeTab = { url: "https://example.com" }): { lastFocused = focusNow; for (const listener of removedListeners) listener(windowId); }, - update: (change, next = current) => { - current = next; - for (const listener of updatedListeners) listener(1, change, next); + update: (change, next = current, tabId = 1) => { + if (tabId === 1) current = next; + else others.set(tabId, next); + for (const listener of updatedListeners) listener(tabId, change, next); }, connect(name, senderId = EXTENSION_ID, senderUrl = EXTENSION_PAGE) { const port: FakeUiPort = { posted: [], onMessageListeners: [], onDisconnectListeners: [] }; @@ -903,3 +976,676 @@ describe("backgroundKeepalive", () => { expect(KEEPALIVE_MS).toBeLessThan(30_000); }); }); + +/** Stand-ins for a music site and a video site, beside `arcade`; `detected` is every run of their code. */ +function players(): { registry: ActivityRegistry; detected: string[] } { + const detected: string[] = []; + const registry = arcade(); + for (const [id, host, type] of [ + ["tunes", "tunes.example", "listening"], + ["movies", "movies.example", "watching"], + ] as const) { + registry.register({ + info: { id, name: id, hosts: [host], source: "parousia" }, + matcher: (url) => url.hostname === host, + detect: ({ url, title }) => { + detected.push(`${id}: ${title}`); + return { id, name: id, type, details: title, url: url.href }; + }, + }); + } + return { registry, detected }; +} + +const NOWHERE: FakeTab = { url: "https://example.com", title: "Example" }; +const song = (title: string, audible = true): FakeTab => ({ + url: "https://tunes.example/play", + title, + audible, +}); +const film = (title: string, audible = true): FakeTab => ({ + url: "https://movies.example/watch", + title, + audible, +}); +const CHESS: FakeTab = { + url: "https://arcade.example/chess", + title: "Chess - Arcade", + audible: true, +}; +const MEDIA_ON = { preferences: { showMediaPresence: true } }; + +describe("Show media presence", () => { + /** Starts with `first` as tab 1, and gives back what's shared as it changes. */ + async function open( + first: FakeTab, + stored: Record = MEDIA_ON, + storageDelayMs = 0, + running: Parameters[3] = {}, + ) { + const chromeMock = installChromeMock(first, stored, storageDelayMs, running); + const link = fakeLink(); + const { registry, detected } = players(); + startBackground("test", { link, bridge: fakeBridge(), registry, pages: quietPages }); + await tick(); + const ids = (): Array => + link.sent.map((presence) => presence.activity?.id ?? null); + const shown = (): { id?: string; details?: string } | null => + link.sent.at(-1)?.activity ?? null; + return { chromeMock, link, detected, ids, shown }; + } + + test("is off by default: music stops showing once another site is shared", async () => { + const { chromeMock, shown } = await open(song("Song A"), {}); + expect(shown()?.id).toBe("tunes"); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()).toBeNull(); + }); + + test("on, music keeps showing on a site without an Activity, with no gap in between", async () => { + const { chromeMock, ids, shown } = await open(song("Song A")); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + // Nothing between: the presence was never cleared, so Discord never flickered. + expect(ids().slice(ids().indexOf("tunes"))).toEqual(["tunes"]); + }); + + test("a browser page the extension can't see keeps it too", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, { title: "New Tab" }, 1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + }); + + test("it follows the tab it keeps: the next track shows, and stopping clears", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + + chromeMock.update({ title: "Song B" }, song("Song B"), 1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song B" }); + + chromeMock.update({ audible: false }, song("Song B", false), 1); + await tick(); + expect(shown()).toBeNull(); + }); + + test("playing again in the background brings it back", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + chromeMock.update({ audible: false }, song("Song A", false), 1); + await tick(); + expect(shown()).toBeNull(); + chromeMock.update({ audible: true }, song("Song A"), 1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + }); + + test("music that was paused when someone left the tab is not kept", async () => { + const { chromeMock, shown } = await open(song("Song A", false)); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()).toBeNull(); + }); + + test("closing the tab it plays in ends it", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()?.id).toBe("tunes"); + chromeMock.remove(1); + await tick(); + expect(shown()).toBeNull(); + }); + + test("leaving the tab for another site and back is not the end of it", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + chromeMock.activate(1, song("Song A"), 1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + }); + + test("an enabled Activity on the current tab comes first", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, CHESS, 1); + await tick(); + expect(shown()).toMatchObject({ id: "arcade", details: "Playing Chess" }); + chromeMock.activate(3, NOWHERE, 1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + }); + + test("sound alone is not music: a game or a page with a video ad is not kept", async () => { + const { chromeMock, shown } = await open(CHESS); + expect(shown()?.id).toBe("arcade"); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()).toBeNull(); + }); + + test("it comes before the Default Activity, which shows when there is no music", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.saveDefault({ enabled: true, name: "Studying", elapsed: false }); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes" }); + chromeMock.update({ audible: false }, song("Song A", false), 1); + await tick(); + expect(shown()).toMatchObject({ id: "parousia:default", name: "Studying" }); + }); + + test("turning the setting off clears it at once; on again, it is not brought back from before", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()?.id).toBe("tunes"); + chromeMock.savePreferences({ showMediaPresence: false }); + await tick(); + expect(shown()).toBeNull(); + chromeMock.savePreferences({ showMediaPresence: true }); + await tick(); + expect(shown()).toBeNull(); + }); + + test("an open UI is told when what is shown is music kept from another tab, and when it is not any more", async () => { + const { chromeMock } = await open(song("Song A")); + const port = chromeMock.connect(UI_PORT_NAME); + const last = (): unknown => + port.posted.filter((m) => (m as { type: string }).type === "activity").at(-1); + // On the music's own tab it is simply what the tab shows. + expect(last()).toEqual({ + type: "activity", + activity: { id: "tunes", name: "tunes", details: "Song A" }, + }); + + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(last()).toEqual({ + type: "activity", + activity: { id: "tunes", name: "tunes", details: "Song A", kept: true }, + }); + + // Back on its own tab, the same presence is no longer kept: the UI hears it though nothing was resent. + chromeMock.activate(1, song("Song A"), 1); + await tick(); + expect(last()).toEqual({ + type: "activity", + activity: { id: "tunes", name: "tunes", details: "Song A" }, + }); + }); + + test("a UI that opens while music is kept hears so at once", async () => { + const { chromeMock } = await open(song("Song A")); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + const port = chromeMock.connect(UI_PORT_NAME); + expect(port.posted).toContainEqual({ + type: "activity", + activity: { id: "tunes", name: "tunes", details: "Song A", kept: true }, + }); + }); + + describe("when the background restarts", () => { + test("the tabs being remembered are written down as they change, for the next time", async () => { + const { chromeMock } = await open(song("Song A")); + expect(chromeMock.session()).toEqual({ mediaTabs: [1] }); + chromeMock.activate(2, film("Film"), 1); + await tick(); + expect(chromeMock.session()).toEqual({ mediaTabs: [1, 2] }); + chromeMock.activate(1, song("Song A"), 1); + await tick(); + expect(chromeMock.session()).toEqual({ mediaTabs: [2, 1] }); + }); + + test("music that was being kept is kept again, with nothing visited since", async () => { + // The background had kept Song A from tab 1 while tab 2 was shared; it stops and starts again. + const { shown } = await open(song("Song A"), MEDIA_ON, 0, { + session: { mediaTabs: [1] }, + others: { 2: NOWHERE }, + active: 2, + }); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + }); + + test("without what it wrote down, nothing is kept: a tab nobody shared is never picked up", async () => { + const { shown } = await open(song("Song A"), MEDIA_ON, 0, { + others: { 2: NOWHERE }, + active: 2, + }); + expect(shown()).toBeNull(); + }); + + test("the most recent of the tabs written down is the one kept", async () => { + const { shown } = await open(song("Song A"), MEDIA_ON, 0, { + session: { mediaTabs: [1, 3] }, + others: { 2: NOWHERE, 3: film("Film") }, + active: 2, + }); + expect(shown()).toMatchObject({ id: "movies", details: "Film" }); + }); + + test("a tab that closed meanwhile is dropped, and the next is kept", async () => { + const { chromeMock, shown } = await open(song("Song A"), MEDIA_ON, 0, { + session: { mediaTabs: [1, 3] }, + others: { 2: NOWHERE, 3: film("Film") }, + active: 2, + closed: [3], + }); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + expect(chromeMock.session()).toEqual({ mediaTabs: [1] }); + }); + + test("what was written down is used only as far as it is sound", async () => { + const { shown } = await open(song("Song A"), MEDIA_ON, 0, { + session: { mediaTabs: ["1", 1.5, -1, 0, null, 1] }, + others: { 2: NOWHERE }, + active: 2, + }); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + const none = await open(song("Song A"), MEDIA_ON, 0, { + session: { mediaTabs: "1" }, + others: { 2: NOWHERE }, + active: 2, + }); + expect(none.shown()).toBeNull(); + }); + + test("with the setting off, none of it is brought back, and what was written down is forgotten", async () => { + const { chromeMock, shown } = await open(song("Song A"), {}, 0, { + session: { mediaTabs: [1] }, + others: { 2: NOWHERE }, + active: 2, + }); + expect(shown()).toBeNull(); + await tick(); + expect(chromeMock.session()).toEqual({ mediaTabs: [] }); + }); + + test("turning the setting off forgets what was written down", async () => { + const { chromeMock } = await open(song("Song A")); + expect(chromeMock.session()).toEqual({ mediaTabs: [1] }); + chromeMock.savePreferences({ showMediaPresence: false }); + await tick(); + expect(chromeMock.session()).toEqual({ mediaTabs: [] }); + }); + }); + + describe("with several players", () => { + test("only the one shared most recently shows, and the one before it takes over when it stops", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, film("Film"), 1); + await tick(); + expect(shown()).toMatchObject({ id: "movies" }); + chromeMock.activate(3, NOWHERE, 1); + await tick(); + expect(shown()).toMatchObject({ id: "movies", details: "Film" }); + + chromeMock.update({ audible: false }, film("Film", false), 2); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + + chromeMock.update({ audible: false }, song("Song A", false), 1); + await tick(); + expect(shown()).toBeNull(); + + chromeMock.update({ audible: true }, film("Film"), 2); + await tick(); + expect(shown()).toMatchObject({ id: "movies" }); + }); + + test("they never trade places while both play, even as the other changes track", async () => { + const { chromeMock, ids } = await open(song("Song A")); + chromeMock.activate(2, film("Film"), 1); + await tick(); + chromeMock.activate(3, NOWHERE, 1); + await tick(); + const from = ids().length; + + chromeMock.update({ title: "Song B" }, song("Song B"), 1); + await tick(); + chromeMock.update({ title: "Song C" }, song("Song C"), 1); + await tick(); + expect(ids().slice(from)).toEqual([]); + }); + + test("visiting a player again makes it the most recent", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, film("Film"), 1); + await tick(); + chromeMock.activate(1, song("Song A"), 1); + await tick(); + chromeMock.activate(3, NOWHERE, 1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + }); + + test("closing the one shown hands over to the other", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, film("Film"), 1); + await tick(); + chromeMock.activate(3, NOWHERE, 1); + await tick(); + chromeMock.remove(2); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + }); + }); + + describe("an Activity that is off", () => { + const OFF = { ...MEDIA_ON, activities: { tunes: { on: false } } }; + + test("is never run, and never kept, even with music playing in it", async () => { + const { chromeMock, detected, shown } = await open(song("Song A"), OFF); + expect(shown()).toBeNull(); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()).toBeNull(); + expect(detected).toEqual([]); + }); + + test("is not run at startup before its switch has been read", async () => { + // The stored states arrive late: until they do, every Activity is at its default (on). + const { chromeMock, detected, shown } = await open(song("Song A"), OFF, 40); + await new Promise((resolve) => setTimeout(resolve, 120)); + expect(detected).toEqual([]); + expect(shown()).toBeNull(); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(detected).toEqual([]); + }); + + test("turned off while its music is kept, it ends at once and none of its code runs again", async () => { + const { chromeMock, detected, shown } = await open(song("Song A")); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()?.id).toBe("tunes"); + const runs = detected.length; + + chromeMock.saveStates({ tunes: { on: false } }); + await tick(); + expect(shown()).toBeNull(); + chromeMock.update({ title: "Song B" }, song("Song B"), 1); + await tick(); + expect(shown()).toBeNull(); + expect(detected).toHaveLength(runs); + }); + + test("turned on again, it starts over from the tab being shared, not from before", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + chromeMock.saveStates({ tunes: { on: false } }); + await tick(); + chromeMock.saveStates({}); + await tick(); + // The tab is still remembered and still playing, so it counts again. + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + }); + }); + + describe("in private windows", () => { + test("music in a private tab is not kept when private windows are paused", async () => { + const { chromeMock, shown } = await open({ ...song("Song A"), incognito: true }); + expect(shown()).toBeNull(); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()).toBeNull(); + }); + + test("none of an Activity's code runs for a private tab that is paused", async () => { + const { detected } = await open({ ...song("Song A"), incognito: true }); + expect(detected).toEqual([]); + }); + + test("when private windows are shared, music in one is kept like any other", async () => { + const { chromeMock, shown } = await open( + { ...song("Song A"), incognito: true }, + { preferences: { showMediaPresence: true, incognito: "share" } }, + ); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + }); + + test("nothing is kept onto a private tab that is paused", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, { ...NOWHERE, incognito: true }, 1); + await tick(); + expect(shown()).toBeNull(); + }); + }); + + describe("away from the browser", () => { + const AWAY = { preferences: { showMediaPresence: true, idleTimeoutMinutes: 0 } }; + + test("sound in the tab that is kept keeps it going", async () => { + const { chromeMock, shown } = await open(song("Song A"), AWAY); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + chromeMock.focus(-1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + + chromeMock.update({ audible: false }, song("Song A", false), 1); + await tick(); + expect(shown()).toBeNull(); + }); + + test("without the setting, leaving the browser clears it as it always did", async () => { + const { chromeMock, shown } = await open(song("Song A"), { + preferences: { idleTimeoutMinutes: 0 }, + }); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + chromeMock.focus(-1); + await tick(); + expect(shown()).toBeNull(); + }); + }); + + test("a private player kept under Share as usual is not looked at again once Pause activity is set", async () => { + const { chromeMock, shown, detected } = await open( + { ...song("Song A"), incognito: true }, + { preferences: { showMediaPresence: true, incognito: "share" } }, + ); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + + chromeMock.savePreferences({ showMediaPresence: true, incognito: "pause" }); + await tick(); + expect(shown()).toBeNull(); + const runs = detected.length; + + // Its song changes, and it's visited again: its Activity isn't run, and nothing is shown. + chromeMock.update({ title: "Song B" }, { ...song("Song B"), incognito: true }, 1); + await tick(); + chromeMock.activate(3, NOWHERE, 1); + await tick(); + expect(detected.length).toBe(runs); + expect(shown()).toBeNull(); + }); + + test("turning Show media presence off while a lookup is in flight publishes nothing afterwards", async () => { + const { chromeMock, shown } = await open(song("Song A")); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()?.id).toBe("tunes"); + + // The next refresh waits on its lookups; the setting goes off while it does. + chromeMock.slowTab(1, 60); + chromeMock.activate(3, NOWHERE, 1); + // Let the refresh reach the lookup of the remembered player, then switch the feature off. + await new Promise((resolve) => setTimeout(resolve, 10)); + chromeMock.savePreferences({ showMediaPresence: false }); + await new Promise((resolve) => setTimeout(resolve, 250)); + expect(shown()).toBeNull(); + }); +}); + +describe("Show media presence: a tab that is not shown", () => { + /** A music site whose Activity reads what's playing through the collector, so its page has scripts. */ + const tunes: ActivityManifest = { + info: { + id: "tunes", + name: "Tunes", + hosts: ["tunes.example"], + source: "parousia", + data: ["media"], + origins: ["https://tunes.example/*"], + }, + match: { patterns: ["https://tunes.example/*"] }, + }; + + /** The collector in tab 1 as the background sees it: a port to say hello and send what's playing on. */ + function collectorPort() { + const listeners: Array<(message: unknown) => void> = []; + const port = { + name: PAGE_DATA_PORT, + sender: { id: EXTENSION_ID, url: "https://tunes.example/play", frameId: 0, tab: { id: 1 } }, + posted: [] as Array<{ type: string; on?: boolean }>, + postMessage: (message: { type: string; on?: boolean }) => port.posted.push(message), + disconnect: () => {}, + onMessage: { + addListener: (listener: (message: unknown) => void) => listeners.push(listener), + }, + onDisconnect: { addListener: () => {} }, + send: (message: unknown) => listeners.forEach((listener) => listener(message)), + }; + return port; + } + + async function open(stored: Record = MEDIA_ON, first: FakeTab = song("Song A")) { + const chromeMock = installChromeMock(first, { + ...stored, + activities: { tunes: { on: true } }, + }); + const link = fakeLink(); + const registry = arcade(); + registry.register( + registered(tunes, { + detect: ({ url, media }) => ({ + id: "tunes", + name: "Tunes", + type: "listening", + details: media?.title ?? "Nothing yet", + url: url.href, + }), + }), + ); + registry.register({ + info: { id: "movies", name: "Movies", hosts: ["movies.example"], source: "parousia" }, + matcher: (url) => url.hostname === "movies.example", + detect: ({ title }) => ({ id: "movies", name: "Movies", type: "watching", details: title }), + }); + let connect: (port: Port) => void = () => {}; + const pages: PageBrowser = { + ...quietPages, + onConnect: (listener) => { + connect = listener; + }, + grants: async () => ({ all: false, origins: ["https://tunes.example/*"] }), + }; + startBackground("test", { + link, + bridge: fakeBridge(), + registry, + natives: [tunes], + pages, + }); + await tick(); + const port = collectorPort(); + connect(port); + port.send({ type: "hello", activity: "tunes" }); + await tick(); + const shown = (): { id?: string; details?: string } | null => + link.sent.at(-1)?.activity ?? null; + const settleReports = (): Promise => new Promise((resolve) => setTimeout(resolve, 260)); + return { chromeMock, link, port, shown, settleReports }; + } + + const backgroundMessages = (port: { posted: Array<{ type: string; on?: boolean }> }) => + port.posted.filter((message) => message.type === "background"); + + test("a tab whose music is kept is told to keep reading, and told to stop when it is not kept", async () => { + const { chromeMock, port } = await open(); + expect(backgroundMessages(port)).toEqual([{ type: "background", on: true }]); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(backgroundMessages(port)).toEqual([{ type: "background", on: true }]); + + chromeMock.savePreferences({ showMediaPresence: false }); + await tick(); + expect(backgroundMessages(port)).toEqual([ + { type: "background", on: true }, + { type: "background", on: false }, + ]); + }); + + test("without the setting a tab is never told to read in the background", async () => { + const { chromeMock, port } = await open({}); + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(backgroundMessages(port).filter((message) => message.on)).toEqual([]); + }); + + test("a song skipped in a tab that is not shown reaches Discord without going back to it", async () => { + const { chromeMock, port, shown, settleReports } = await open(); + port.send({ type: "data", data: { media: { title: "Song A", playing: true } } }); + await settleReports(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + + chromeMock.activate(2, NOWHERE, 1); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song A" }); + + // The tab keeps reading in the background; its next song is news, and the title moves with it. + port.send({ type: "data", data: { media: { title: "Song B", playing: true } } }); + await settleReports(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song B" }); + port.send({ type: "data", data: { media: { title: "Song C", playing: true } } }); + await settleReports(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song C" }); + }); + + test("with another player shared more recently, the one that moves on in the background does not take over", async () => { + const { chromeMock, link, port, shown, settleReports } = await open(); + port.send({ type: "data", data: { media: { title: "Song A", playing: true } } }); + await settleReports(); + chromeMock.activate(2, film("Film"), 1); + await tick(); + chromeMock.activate(3, NOWHERE, 1); + await tick(); + expect(shown()).toMatchObject({ id: "movies", details: "Film" }); + const from = link.sent.length; + + port.send({ type: "data", data: { media: { title: "Song B", playing: true } } }); + await settleReports(); + expect(shown()).toMatchObject({ id: "movies", details: "Film" }); + expect(link.sent.length).toBe(from); + + // When the film stops, the song it left behind is the current one, not the old one. + chromeMock.update({ audible: false }, film("Film", false), 2); + await tick(); + expect(shown()).toMatchObject({ id: "tunes", details: "Song B" }); + }); + + test("turning Pause activity on stops the scripts already running in a private tab", async () => { + const { chromeMock, port } = await open( + { preferences: { showMediaPresence: true, incognito: "share" } }, + { ...song("Song A"), incognito: true }, + ); + expect(port.posted.some((message) => message.type === "stop")).toBe(false); + + chromeMock.savePreferences({ showMediaPresence: true, incognito: "pause" }); + await tick(); + expect(port.posted.at(-1)).toEqual({ type: "stop" }); + }); +}); diff --git a/browser/src/platforms/background.ts b/browser/src/platforms/background.ts index c1d3a0d..4450ca3 100644 --- a/browser/src/platforms/background.ts +++ b/browser/src/platforms/background.ts @@ -25,6 +25,7 @@ import { } from "../core/desktop-connection"; import { createLogger } from "../core/logger"; import { PresenceController } from "../core/lifecycle"; +import { MediaTabs, isMediaActivity } from "../core/media-presence"; import { DEFAULT_PREFERENCES, applyPreferences, @@ -33,7 +34,7 @@ import { watchPreferences, type Preferences, } from "../core/preferences"; -import { ActivityRegistry } from "../core/registry"; +import { ActivityRegistry, type Page } from "../core/registry"; import { PresenceRuntime } from "../core/runtime"; import type { PresenceTransport } from "../core/transport"; import { @@ -63,6 +64,23 @@ export function createDesktopConnection(): DesktopConnection { export const KEEPALIVE_MS = 20_000; +/** + * Where the tabs whose music or video is kept are written down. MV3 stops the + * background and starts it again, and a tab number lasts as long as the + * browser is open, as `storage.session` does: tab numbers and nothing else. + */ +const MEDIA_TABS_KEY = "mediaTabs"; +const MAX_MEDIA_TABS = 64; + +/** The tab numbers written down, as far as they're sound: the most recent last. */ +function parseMediaTabs(value: unknown): number[] { + if (!Array.isArray(value)) return []; + const tabs: unknown[] = value; + return tabs + .filter((tab): tab is number => Number.isSafeInteger(tab) && (tab as number) > 0) + .slice(-MAX_MEDIA_TABS); +} + /** * An MV3 background is stopped after about 30 seconds without extension * events or API calls, and its connections close with it: Desktop and @@ -75,7 +93,8 @@ export const KEEPALIVE_MS = 20_000; * Returns a switch: `true` while there's something to share. */ export function backgroundKeepalive( - ping: () => void = () => void chrome.runtime.getPlatformInfo(), + // Best-effort: a test double, or a context without the API, keeps running. + ping: () => void = () => void globalThis.chrome?.runtime?.getPlatformInfo?.(), intervalMs: number = KEEPALIVE_MS, ): (active: boolean) => void { let timer: ReturnType | null = null; @@ -112,12 +131,17 @@ export function createDiscordBridge(): DiscordBridge { * when it has settings of its own (the Default Activity is set up on its own * page). */ -export function uiActivity(activity: Activity | null, configurable = false): UiActivity | null { +export function uiActivity( + activity: Activity | null, + configurable = false, + kept = false, +): UiActivity | null { if (!activity) return null; return { id: activity.id, name: activity.name, ...(configurable && { configurable }), + ...(kept && { kept }), ...(activity.details !== undefined && { details: activity.details }), ...(activity.state !== undefined && { state: activity.state }), ...(activity.timestamps?.start !== undefined && { startedAt: activity.timestamps.start }), @@ -239,13 +263,43 @@ export function startBackground(appName: string, options: BackgroundOptions = {} let idleTimer: ReturnType | null = null; /** The idle timeout ran out: nothing is shared again until the browser has focus, or sound plays. */ let idleExpired = false; + /** + * The tabs whose music or video can be kept (see core/media-presence.ts); + * empty while the setting is off. Their page scripts read even while the tab + * isn't shown, which is how a song skipped there is noticed. + */ + const mediaTabs = new MediaTabs((tabs) => { + pages.keepReading(tabs); + // Without a session store the tabs are kept only until the background stops. + void chrome.storage.session?.set({ [MEDIA_TABS_KEY]: tabs }).catch(() => {}); + }); + /** The tabs written down before the background last stopped, put back once, before they're first needed. */ + let restoring: Promise | null = null; + const restoreMediaTabs = (): Promise => + (restoring ??= (async () => { + try { + const written = (await chrome.storage.session.get(MEDIA_TABS_KEY))[MEDIA_TABS_KEY]; + // Switched off while this was being read: nothing comes back. + if (preferences.showMediaPresence) mediaTabs.restore(parseMediaTabs(written)); + } catch { + // No session store here, or nothing written. + } + })()); + /** The music or video kept from another tab for the page being shared, which `refresh` decides before it resolves. */ + let kept: Activity | null = null; + /** The last refresh found no Activity of its own on the tab shared, so those other tabs matter. */ + let watchingMedia = false; + /** What's shared is that kept music or video, not what the tab shared has; the popup says so. */ + let keptShown = false; + /** What UIs were last told about that. */ + let keptTold = false; const pages = new PageHost( registry, options.pages ?? chromePageBrowser(), options.natives ?? [], (tabId) => { - if (tabId === activeTabId) void refresh(); + if (tabId === activeTabId || (watchingMedia && mediaTabs.has(tabId))) void refresh(); }, ); const malSync = new MalSyncSource({ @@ -255,6 +309,10 @@ export function startBackground(appName: string, options: BackgroundOptions = {} const runtime = new PresenceRuntime(registry, { usable: (info, url) => pages.usable(info, url), settings: (info) => settingValues(info, states), + media: () => { + keptShown = kept !== null; + return kept; + }, fallback: () => defaultActivityToShow(defaultActivity, defaultSince ?? Date.now()), // What MAL-Sync shows is a page's own reading, so Settings > Privacy limits it like a PreMiD // Activity's. Its cover is the series itself: without media details it isn't a picture to share. @@ -287,7 +345,13 @@ export function startBackground(appName: string, options: BackgroundOptions = {} /** The shared Activity as UIs show it: with whether it has settings to change from the popup. */ const shown = (activity: Activity | null): UiActivity | null => { const info = activity && activity.id !== DEFAULT_ACTIVITY_ID ? registry.get(activity.id) : null; - return uiActivity(activity, (info?.settings?.length ?? 0) > 0); + return uiActivity(activity, (info?.settings?.length ?? 0) > 0, keptShown); + }; + const announce = (activity: Activity | null): void => { + keptTold = keptShown; + if (watchers.size === 0) return; + const ui = shown(activity); + for (const watcher of watchers) watcher(ui); }; const controller = new PresenceController(runtime, { send: (presence) => { @@ -297,12 +361,18 @@ export function startBackground(appName: string, options: BackgroundOptions = {} activity?.id === DEFAULT_ACTIVITY_ID ? (activity.timestamps?.start ?? defaultSince) : null; link.send(presence); bridge.send(presence); - if (watchers.size > 0) { - const ui = shown(activity); - for (const watcher of watchers) watcher(ui); - } + announce(activity); }, }); + /** Publishes the page's presence. UIs are told if it now comes from another tab, or no longer does, though it is as it was. */ + const update = ( + page: Page | null, + share: (activity: Activity | null) => Activity | null, + ): void => { + keptShown = false; + controller.update(page, share); + if (keptShown !== keptTold) announce(controller.getActivity()); + }; serveUi(link, bridge, { get: () => shown(controller.getActivity()), @@ -323,6 +393,7 @@ export function startBackground(appName: string, options: BackgroundOptions = {} * someone looked at Discord, or opened the popup), or for the Idle Timeout, * if there is one. Either way, what's shared keeps following the tab: a song * that changes while someone's in another window changes in Discord too. + * When it says no, the caller clears, unless music or video is kept. */ function sharingWhileAway(tab: chrome.tabs.Tab): boolean { if (windowFocused || tab.audible === true) { @@ -333,32 +404,81 @@ export function startBackground(appName: string, options: BackgroundOptions = {} const minutes = preferences.idleTimeoutMinutes; if (minutes === 0 || idleExpired) { stopIdleTimer(); - controller.clear(); return false; } idleTimer ??= setTimeout(() => { idleTimer = null; idleExpired = true; - controller.clear(); + // Music or video kept from another tab goes on with its sound: look again rather than clear. + if (preferences.showMediaPresence) void refresh(); + else controller.clear(); }, minutes * 60_000); return true; } + /** + * The music or video in tab `tabId` as it is now. None unless sound is + * playing there and its Activity is on and presents media: the same + * Activity code and switches as for the tab shared, and nothing injected + * into a tab nobody is looking at. Shared as that tab shares: a private tab + * that's paused keeps nothing. + */ + async function mediaOf(tabId: number): Promise { + const tab = await chrome.tabs.get(tabId); + if (tab.incognito && preferences.incognito === "pause") { + // Under "Pause activity" a private tab runs nothing, not even to look for its music. + mediaTabs.forget(tabId); + return null; + } + if (tab.audible !== true || !tab.url) return null; + const url = new URL(tab.url); + if (!/^https?:$/.test(url.protocol)) return null; + const page: Page = { + url, + title: tab.title ?? "", + ...(tab.favIconUrl && { favicon: tab.favIconUrl }), + ...(await pages.peek(tabId, url)), + }; + const detected = runtime.detect(page); + if (!detected || !isMediaActivity(detected)) return null; + return applyPreferences(detected, preferences, tab.incognito, registry.get(detected.id)?.name); + } + + /** + * For "Show media presence": notes whether the tab shared (`tabId`, with + * `own`, what its Activity detects) is playing music or video, and when it + * has nothing of its own, finds the music or video to keep from another + * tab. Off, nothing is noted and nothing is kept. + */ + async function keptFor( + tabId: number, + tab: chrome.tabs.Tab, + own: Activity | null, + ): Promise { + watchingMedia = preferences.showMediaPresence && own === null; + if (!preferences.showMediaPresence) return null; + await restoreMediaTabs(); + mediaTabs.shared(tabId, own, tab.audible === true); + return own === null ? ((await mediaTabs.pick(tabId, mediaOf))?.media ?? null) : null; + } + + /** Counts refreshes, so one overtaken by a newer refresh or a preference change publishes nothing. */ + let passes = 0; + async function refresh(): Promise { + const pass = ++passes; + const overtaken = (tabId: number): boolean => pass !== passes || tabId !== activeTabId; if (activeTabId === null) { stopIdleTimer(); malSync.watch(null); + watchingMedia = false; controller.clear(); return; } try { const tabId = activeTabId; const tab = await chrome.tabs.get(tabId); - if (tabId !== activeTabId) return; - if (!sharingWhileAway(tab)) { - malSync.watch(null); - return; - } + if (overtaken(tabId)) return; const share = (activity: Activity | null): Activity | null => applyPreferences( activity, @@ -366,38 +486,88 @@ export function startBackground(appName: string, options: BackgroundOptions = {} tab.incognito, activity ? registry.get(activity.id)?.name : undefined, ); + if (tab.incognito && preferences.incognito === "pause") { + // Nothing of a paused private tab is shared, so no Activity runs there: not its code, + // not its page scripts, and MAL-Sync isn't asked about it either. + stopIdleTimer(); + malSync.watch(null); + watchingMedia = false; + mediaTabs.forget(tabId); + pages.stopTabs([tabId]); + controller.clear(); + return; + } + if (!sharingWhileAway(tab)) { + malSync.watch(null); + // Away, the tab shared says nothing; sound in a tab whose music or video is kept does. + const found = await keptFor(tabId, tab, null); + if (overtaken(tabId)) return; + kept = found; + if (kept) update(null, share); + else controller.clear(); + return; + } if (!tab.url) { - // A page the extension can't see (a browser page): only the Default Activity, if one is set up. + // A page the extension can't see (a browser page): only music or video kept, or the Default Activity, if one is set up. malSync.watch(null); - controller.update(null, share); + const found = await keptFor(tabId, tab, null); + if (overtaken(tabId)) return; + kept = found; + update(null, share); return; } const url = new URL(tab.url); - // A private tab that's paused is never asked about, so MAL-Sync isn't woken for it either. - const asked = - /^https?:$/.test(url.protocol) && !(tab.incognito && preferences.incognito === "pause"); - malSync.watch(asked ? { id: tabId, url } : null); + malSync.watch(/^https?:$/.test(url.protocol) ? { id: tabId, url } : null); // Site access, the page data it's granted, and what the page gave, for an Activity that reads pages. const page = await pages.page(tabId, url); - if (tabId !== activeTabId) return; - controller.update( - { - url, - title: tab.title ?? "", - ...(tab.favIconUrl && { favicon: tab.favIconUrl }), - ...page, - }, - share, + if (overtaken(tabId)) return; + const detail: Page = { + url, + title: tab.title ?? "", + ...(tab.favIconUrl && { favicon: tab.favIconUrl }), + ...page, + }; + // Detected here too only for the setting, which is off until someone turns it on. + const found = await keptFor( + tabId, + tab, + preferences.showMediaPresence ? runtime.detect(detail) : null, ); + if (overtaken(tabId)) return; + kept = found; + update(detail, share); } catch { - // Tab vanished between the event firing and this lookup running. + // Tab vanished between the event firing and this lookup running. A newer refresh has the say. + if (pass !== passes) return; malSync.watch(null); + watchingMedia = false; controller.clear(); } } + /** Under "Pause activity", private tabs run nothing: their music is forgotten, and scripts already running there stop. */ + async function stopPrivateTabs(): Promise { + const tabs: chrome.tabs.Tab[] = await chrome.tabs.query({}); + const privateTabs = tabs.flatMap((tab) => + tab.incognito && tab.id !== undefined ? [tab.id] : [], + ); + for (const tabId of privateTabs) mediaTabs.forget(tabId); + pages.stopTabs(privateTabs); + } + const usePreferences = (next: Preferences): void => { preferences = next; + if (next.incognito === "pause") void stopPrivateTabs().catch(() => {}); + if (!next.showMediaPresence) { + mediaTabs.clear(); + watchingMedia = false; + kept = null; + // Nothing is brought back for a setting that was off: what was written down before is forgotten. + if (restoring === null) { + restoring = Promise.resolve(); + void chrome.storage.session?.set({ [MEDIA_TABS_KEY]: [] }).catch(() => {}); + } + } pages.setPageData(next.pageData); link.setPlatforms(enabledPlatforms(next)); bridge.setEnabled(next.platforms.discord && next.discordRpcExtension); @@ -447,16 +617,26 @@ export function startBackground(appName: string, options: BackgroundOptions = {} chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { const loaded = changeInfo.status === "complete" && pages.active; if (loaded) pages.loaded(tabId); - if (tabId !== activeTabId) return; // The favicon is the last image an Activity without one falls back on, and tabs report it after the page. - const titleMatters = + const titleMatters = (): boolean => (changeInfo.title !== undefined || changeInfo.favIconUrl !== undefined) && tab.url !== undefined && runtime.matches(new URL(tab.url)); + if (tabId !== activeTabId) { + // Music or video kept from this tab follows it: its sound, and the song or video it shows. + if ( + watchingMedia && + mediaTabs.has(tabId) && + (changeInfo.audible !== undefined || changeInfo.url !== undefined || titleMatters()) + ) { + void refresh(); + } + return; + } // Sound starting or stopping decides whether a tab is shared while the browser is out of focus. if ( changeInfo.url !== undefined || - titleMatters || + titleMatters() || loaded || changeInfo.audible !== undefined ) { @@ -466,10 +646,15 @@ export function startBackground(appName: string, options: BackgroundOptions = {} chrome.tabs.onRemoved.addListener((tabId) => { pages.forget(tabId); + const keptFrom = mediaTabs.has(tabId); + mediaTabs.forget(tabId); if (tabId === activeTabId) { activeTabId = null; malSync.watch(null); controller.clear(); + } else if (keptFrom && watchingMedia) { + // The music or video being kept was in this tab: another may take over, or nothing is left. + void refresh(); } }); diff --git a/browser/src/platforms/chromium.bundle.test.ts b/browser/src/platforms/chromium.bundle.test.ts index 7d6eeef..2a97cd9 100644 --- a/browser/src/platforms/chromium.bundle.test.ts +++ b/browser/src/platforms/chromium.bundle.test.ts @@ -42,6 +42,7 @@ describe("chromium bundle", () => { lastError: undefined, getURL: (path: string) => `chrome-extension://self/${path}`, getManifest: () => ({ version: "1.0.0" }), + getPlatformInfo: async () => ({ os: "linux", arch: "x64" }), onConnect: { addListener: (listener: (port: unknown) => void) => connectListeners.push(listener), }, diff --git a/browser/src/popup/popup.html b/browser/src/popup/popup.html index a117329..49cf2ff 100644 --- a/browser/src/popup/popup.html +++ b/browser/src/popup/popup.html @@ -58,9 +58,9 @@ diff --git a/browser/src/popup/popup.ts b/browser/src/popup/popup.ts index 1b6c211..9a505d7 100644 --- a/browser/src/popup/popup.ts +++ b/browser/src/popup/popup.ts @@ -43,6 +43,7 @@ import { type SettingsPageId, type SettingsPageView, } from "../shared/settings-view"; +import { siteOffer, type Sharing } from "../shared/site-offer"; import { updateBanner } from "../shared/update-notice"; import { presenceIcons, @@ -130,12 +131,12 @@ const background = connectToBackground( !activity?.configurable && activity?.id !== DEFAULT_ACTIVITY_ID; renderBadge(byId("status-badge"), state, sharing); renderHome(); - if (!activity) void findForTab(); + if (sharingNow() !== "activity") void findForTab(); }, ); -// Home: what's shared; or else the tab's Activity that isn't running, and -// why; or else a line saying there's nothing to share here. +// Home: what's shared, with the tab's site Activity under it when it has one +// (see shared/site-offer.ts for when that's offered or noted). interface Found { info: ActivityInfo; @@ -149,19 +150,29 @@ let busy = false; /** The browser declined the last request; the card says so until the next click or tab. */ let declined = false; +/** + * What's being shared: nothing; something that isn't the tab's own Activity + * (the Default Activity, or music or video kept from another tab); or a site's + * Activity (or `undefined` until the background says). + */ +function sharingNow(): Sharing { + if (shared === null) return "nothing"; + return shared?.id === DEFAULT_ACTIVITY_ID || shared?.kept === true ? "other" : "activity"; +} + function renderHome(): void { const offline = isOffline(state); + const sharing = sharingNow(); + const offer = offline || !found ? "none" : siteOffer(sharing, found.status); byId("offline-view").hidden = !offline; byId("activity-view").hidden = offline || !shared; - const idle = !offline && shared === null; - const offer = idle && found !== null && found.status !== "on" ? found : null; - byId("suggestion-view").hidden = offer === null; - byId("idle-view").hidden = !idle || offer !== null; + byId("suggestion-view").hidden = offer !== "offer"; + byId("idle-view").hidden = offline || sharing !== "nothing" || offer === "offer"; byId("idle-view").textContent = found?.status === "on" - ? t("{name} is on. Nothing to share on this page yet.", { name: found.info.name }) - : t("Nothing to share on this page."); - if (offer) renderOffer(offer); + ? t("{name} is on. Nothing to share here yet.", { name: found.info.name }) + : t("Nothing to share here."); + if (found && offer === "offer") renderOffer(found); } function renderOffer({ info, status }: Found): void { @@ -172,20 +183,26 @@ function renderOffer({ info, status }: Found): void { const sites = [...new Set(missingSites(info, grants).map(siteName))].join(", "); const note = byId("suggestion-note"); const action = buttonById("suggestion-action"); + if (status === "on") { + note.textContent = t("{name} is on. Nothing to share here yet.", { name: info.name }); + action.hidden = true; + return; + } + action.hidden = false; if (status === "off") { note.textContent = declined - ? t("Your browser didn't allow access to its sites, so it stays off.") + ? t("Your browser declined access to its sites, so it stays off.") : sites ? t( - "An Activity for this site, turned off. Turning it on asks your browser for access to {sites}.", + "There's an Activity for this site, and it's off. Turning it on asks your browser for access to {sites}.", { sites }, ) - : t("An Activity for this site, turned off."); + : t("There's an Activity for this site, and it's off."); action.textContent = t("Turn on"); } else { note.textContent = declined - ? t("Your browser didn't allow access to {sites}, so it still can't run here.", { sites }) - : t("It's on, but your browser hasn't given it access to {sites}, so it can't run here.", { + ? t("Your browser declined access to {sites}, so it still can't run here.", { sites }) + : t("It's on, but it has no access to {sites}, so it can't run here.", { sites, }); action.textContent = t("Allow access"); @@ -235,7 +252,7 @@ byId("suggestion-action").addEventListener("click", () => { watchActivityStates((next) => { states = next; - if (shared === null) void findForTab(); + if (sharingNow() !== "activity") void findForTab(); }); watchGrants(() => { void readGrants().then((next) => { @@ -249,7 +266,7 @@ void Promise.all([ ]).then(([stored, granted]) => { states = stored; grants = granted; - if (shared === null) void findForTab(); + if (sharingNow() !== "activity") void findForTab(); }); // Views: home, the settings list, one settings page, and the shared Activity's settings. diff --git a/browser/src/premid/page.test.ts b/browser/src/premid/page.test.ts index 270db4a..97de420 100644 --- a/browser/src/premid/page.test.ts +++ b/browser/src/premid/page.test.ts @@ -233,12 +233,15 @@ describe("an Activity in a page", () => { const location = { href: "https://music.example/" }; scope.window = window; scope.location = location; - scope.document = { + const documentListeners = new Map void>(); + const document = { hidden: false, readyState: "complete", - addEventListener: () => {}, + addEventListener: (type: string, listener: () => void) => + documentListeners.set(type, listener), getElementsByTagName: () => [], }; + scope.document = document; scope.chrome = { runtime: { connect: () => ({ @@ -259,6 +262,13 @@ describe("an Activity in a page", () => { location, posted, reports: () => posted.filter((message) => message.type === "activity"), + /** Hides or shows the page, as a tab switch does. */ + setHidden: (hidden: boolean) => { + document.hidden = hidden; + documentListeners.get("visibilitychange")?.(); + }, + /** A message from the background. */ + receive: (message: object) => receivers.forEach((receive) => receive(message)), stop: () => receivers.forEach((receive) => receive({ type: "stop" })), }; } @@ -312,6 +322,49 @@ describe("an Activity in a page", () => { stop(); }, 15_000); + test("in a tab that is not shown it reads again only while the background asks it to", async () => { + const { bridge, setHidden, receive, stop } = page(); + const api = bound(bridge, "premid:Music"); + if (!api) throw new Error("the Activity wasn't bound"); + const [Presence] = api; + const presence = new Presence({ clientId: "1" }) as { + on: (event: string, listener: () => void) => void; + }; + let updates = 0; + presence.on("UpdateData", () => { + updates++; + }); + await tick(); + expect(updates).toBeGreaterThan(0); + + // A tab nobody is looking at reads nothing: that is why a skipped song went unnoticed. + setHidden(true); + await tick(); + const quiet = updates; + await tick(); + expect(updates).toBe(quiet); + + // Its music is being kept: it reads again, at once and then every second, while hidden. + receive({ type: "background", on: true }); + await new Promise((resolve) => setTimeout(resolve, 50)); + expect(updates).toBeGreaterThan(quiet); + const reading = updates; + await tick(); + expect(updates).toBeGreaterThan(reading); + + // Kept no more: quiet again. + receive({ type: "background", on: false }); + const stopped = updates; + await tick(); + expect(updates).toBe(stopped); + + // Shown again, it reads as ever. + setHidden(false); + await tick(); + expect(updates).toBeGreaterThan(stopped); + stop(); + }, 15_000); + test("tells the background of a setting it hides or shows once, however often it asks", () => { const { bridge, posted, stop } = page(); const api = bound(bridge, "premid:Music"); diff --git a/browser/src/premid/page.ts b/browser/src/premid/page.ts index 2a07234..3413a81 100644 --- a/browser/src/premid/page.ts +++ b/browser/src/premid/page.ts @@ -60,6 +60,8 @@ const isObject = (value: unknown): value is Data => const tickers = new Set<() => Promise>(); const inFlight = new Set<() => Promise>(); let timer: ReturnType | null = null; +/** The background keeps this tab's music or video, so it reads even while the tab isn't shown. */ +let background = false; /** How long one update may take before it's given up on and the next one starts. */ export const MAX_UPDATE_MS = 10_000; @@ -97,8 +99,14 @@ export async function runUpdates( const tick = (): Promise => runUpdates(tickers); +/** The background says whether to keep reading while the page isn't shown (`ToPage`, `background`). */ +function keepReading(on: boolean): void { + background = on; + schedule(); +} + function schedule(): void { - const run = tickers.size > 0 && !document.hidden; + const run = tickers.size > 0 && (!document.hidden || background); if (run && timer === null) { timer = setInterval(() => void tick(), TICK_MS); // At once too, not a second from now: after the Activity's script has @@ -608,6 +616,8 @@ export function createApi( this.answers.answer(message.nonce, message.value); } else if (message.type === "frame-data") { void emit(this.listeners, "iFrameData", message.data); + } else if (message.type === "background") { + keepReading(message.on); } } @@ -754,6 +764,7 @@ export function createApi( () => ({ type: "hello", activity }), (message) => { if (message.type === "page-result") this.answers.answer(message.nonce, message.value); + else if (message.type === "background") keepReading(message.on); }, () => {}, ); diff --git a/browser/src/shared/activity-catalog.ts b/browser/src/shared/activity-catalog.ts index d92f569..483a534 100644 --- a/browser/src/shared/activity-catalog.ts +++ b/browser/src/shared/activity-catalog.ts @@ -162,7 +162,7 @@ function requestSites(origins: string[]): Promise { } /** - * "Access your data for all websites": off by default, and only ever asked + * "Allow access to all websites": off by default, and only ever asked * for by its own switch. Turning it off leaves `scripting` for any site * still granted on its own. */ diff --git a/browser/src/shared/connection-status.ts b/browser/src/shared/connection-status.ts index 230762c..1dc0e6d 100644 --- a/browser/src/shared/connection-status.ts +++ b/browser/src/shared/connection-status.ts @@ -145,7 +145,7 @@ export function connectionHelp(state: ConnectionState, origin: string): Connecti case "disconnected": return { title: t("Parousia Desktop couldn't be found"), - detail: t("Launch Parousia Desktop to share your browser activity."), + detail: t("Launch Parousia Desktop to share your presence."), }; default: return null; @@ -167,7 +167,7 @@ export function desktopPlatformLabel( case "showing": return adapter.activity ? t("Showing {activity}", { activity: adapter.activity }) - : t("Showing your activity"); + : t("Showing your presence"); case "connected": case "idle": return t("Ready"); diff --git a/browser/src/shared/presence-view.ts b/browser/src/shared/presence-view.ts index b3a7ed8..e4f17fa 100644 --- a/browser/src/shared/presence-view.ts +++ b/browser/src/shared/presence-view.ts @@ -53,8 +53,8 @@ function renderEmpty(root: HTMLElement, options: PresenceViewOptions): void { const wrapper = element("div", "presence-empty"); wrapper.append( element("div", "presence-empty-visual"), - element("p", "presence-empty-title", t("No activity detected")), - element("p", "presence-empty-subtitle", t("Browse a supported site and it shows up here.")), + element("p", "presence-empty-title", t("No Activity detected")), + element("p", "presence-empty-subtitle", t("Visit a supported site and it appears here.")), ); wrapper.firstElementChild?.append(...iconFor(options, "empty")); root.append(wrapper); diff --git a/browser/src/shared/settings-view.ts b/browser/src/shared/settings-view.ts index 947da55..8d54a9d 100644 --- a/browser/src/shared/settings-view.ts +++ b/browser/src/shared/settings-view.ts @@ -73,7 +73,7 @@ export const SETTINGS_PAGES: readonly PageInfo[] = [ { id: "privacy", title: msg("Privacy"), - subtitle: msg("What's shared, what Activities read, incognito"), + subtitle: msg("What's shared, what Activities read, private windows"), icon: faLock, }, { @@ -112,7 +112,7 @@ export const DATA_LABELS: Record actions.setDesktopSetting("allowUserscripts", checked), "setting-allowUserscripts", @@ -334,7 +334,7 @@ function generalPage(actions: SettingsActions): SettingsPageView { "p", "settings-note", t( - "Parousia Desktop couldn't confirm this connection is yours, so these can't be changed from here. Use the Parousia-Desktop set command or Desktop's own console instead.", + "Parousia Desktop couldn't confirm this connection is yours, so you can't change these here. Use the Parousia-Desktop set command or Desktop's console instead.", ), ); note.id = "settings-note"; @@ -346,7 +346,11 @@ function generalPage(actions: SettingsActions): SettingsPageView { element.append( sectionLabel(t("Language")), group( - controlRow(t("Language"), t("Changing it reloads any open Parousia page."), language.wrapper), + controlRow( + t("Language"), + t("Open Parousia pages reload when you change it."), + language.wrapper, + ), ), sectionLabel(t("Parousia Desktop")), offline, @@ -422,10 +426,17 @@ function appearancePage(): SettingsPageView { function privacyPage(actions: SettingsActions): SettingsPageView { const media = switchRow( - t("Share Media Details"), - t("Include what you're watching or reading, not just the site's name."), + t("Share media details"), + t("Include what you're watching or reading, not only the site's name."), (checked) => actions.savePreferences({ shareMediaDetails: checked }), ); + const mediaPresence = switchRow( + t("Show media presence"), + t( + "Keep showing music and video activity when switching to websites without an enabled Activity.", + ), + (checked) => actions.savePreferences({ showMediaPresence: checked }), + ); const stepper = el("div", "stepper"); const minus = el("button", "stepper-button"); @@ -452,8 +463,8 @@ function privacyPage(actions: SettingsActions): SettingsPageView { ); const incognitoRow = el("div", "setting setting-stacked"); const incognitoText = settingText( - t("Incognito Behaviour"), - t("What to do in private windows, if you've allowed Parousia there."), + t("Private windows"), + t("What to do in private windows you've allowed Parousia in."), ); incognitoText.firstElementChild?.setAttribute("id", "setting-incognito"); incognito.input.setAttribute("aria-labelledby", "setting-incognito"); @@ -476,11 +487,10 @@ function privacyPage(actions: SettingsActions): SettingsPageView { sectionLabel(t("What leaves your browser")), group( media.row, + mediaPresence.row, controlRow( - t("Idle Timeout"), - t( - "Keep sharing this long after you switch away from the browser. Sound playing keeps it going.", - ), + t("Idle timeout"), + t("Keep sharing this long after you leave the browser. Sound keeps it going."), stepper, ), incognitoRow, @@ -490,7 +500,7 @@ function privacyPage(actions: SettingsActions): SettingsPageView { "p", "settings-hint", t( - "On sites you've granted, Activities that read pages may take these. Switched off, Parousia doesn't read them, and doesn't show what an Activity's own code read.", + "On sites you've allowed, Activities that read pages may use these. When switched off, Parousia reads none of them and shows no page data from Activities.", ), ), group(...kinds.map(({ row }) => row)), @@ -501,6 +511,7 @@ function privacyPage(actions: SettingsActions): SettingsPageView { pageData = preferences.pageData; for (const { kind, input } of kinds) input.checked = preferences.pageData[kind]; media.input.checked = preferences.shareMediaDetails; + mediaPresence.input.checked = preferences.showMediaPresence; minutes = preferences.idleTimeoutMinutes; value.textContent = formatIdleTimeout(minutes); minus.disabled = stepIdleTimeout(minutes, -1) === minutes; @@ -519,7 +530,7 @@ function platformsPage(actions: SettingsActions): SettingsPageView { const name = PLATFORM_NAMES[id]; const { row, input } = switchRow( t("{name} Rich Presence", { name }), - t("Show your activity on {name}.", { name }), + t("Show your presence on {name}.", { name }), (checked) => { const platforms = { ...currentPlatforms, [id]: checked }; actions.savePreferences({ platforms }); @@ -539,14 +550,14 @@ function platformsPage(actions: SettingsActions): SettingsPageView { "p", "info-note", t( - "Parousia Desktop shows your activity on these apps. Discord works now. Fluxer doesn't yet let other apps show activity on your profile, and Stoat is still being built, so those choices are saved for when they arrive.", + "Parousia Desktop shows your presence on these apps. Discord works now. Fluxer doesn't let other apps show presence yet, and Stoat is still being built. Choices for them are saved until they arrive.", ), ); const bridge = switchRow( t("Discord-RPC-Extension"), t( - "Show Discord presence through Discord-RPC-Extension's app (discord_rpc_ext) on this computer, when it's running. Rich Presence only: nothing else is sent to it or accepted from it.", + "Use Discord-RPC-Extension's app (discord_rpc_ext) on this computer when it's running. Only Rich Presence is sent to it or accepted from it.", ), (checked) => actions.savePreferences({ discordRpcExtension: checked }), ); @@ -556,7 +567,7 @@ function platformsPage(actions: SettingsActions): SettingsPageView { const malSync = switchRow( t("MAL-Sync"), t( - "Show what MAL-Sync recognizes on anime and manga sites as your activity there, in place of the site's own. Parousia asks the MAL-Sync extension about the tab you're on and takes only Rich Presence from it. Turn off MAL-Sync's own Discord Rich Presence setting so it isn't shown twice.", + "Show what MAL-Sync recognizes on anime and manga sites in place of the site's own. Parousia takes only Rich Presence from MAL-Sync. Turn off MAL-Sync's Discord Rich Presence setting so it isn't shown twice.", ), (checked) => actions.savePreferences({ malSync: checked }), ); @@ -598,7 +609,7 @@ function platformsPage(actions: SettingsActions): SettingsPageView { } /** - * Site access: "Access your data for all websites", off by default and only + * Site access: "Allow access to all websites", off by default and only * ever turned on here. Individual sites are the browser's to grant and take * back (its prompt when an Activity is turned on, its extension settings * after), so they aren't listed or revoked from here: a browser won't let an @@ -609,9 +620,9 @@ function platformsPage(actions: SettingsActions): SettingsPageView { */ function accessPage(inPopup: boolean): SettingsPageView { const all = switchRow( - t("Access your data for all websites"), + t("Allow access to all websites"), t( - "Off by default. With it on, Activities that read pages can read any site, without asking site by site. Parousia never turns it on by itself.", + "Off by default. With it on, Activities that read pages can read any site without asking for each one. Parousia never turns it on by itself.", ), (on) => { all.input.disabled = true; @@ -627,7 +638,7 @@ function accessPage(inPopup: boolean): SettingsPageView { "p", "info-note", t( - "Otherwise your browser asks before an Activity reads a site, when you turn the Activity on. Sites you allowed are managed in your browser's settings for this extension.", + "Otherwise, your browser asks before an Activity reads a site, when you turn the Activity on. Manage the sites you've allowed in your browser's settings for this extension.", ), ), ); @@ -640,11 +651,7 @@ function accessPage(inPopup: boolean): SettingsPageView { window.close(); }); element.prepend( - el( - "p", - "info-note", - t("Your browser asks before granting access, which it does from the dashboard."), - ), + el("p", "info-note", t("Your browser asks for access from the dashboard.")), open, ); } diff --git a/browser/src/shared/site-offer.test.ts b/browser/src/shared/site-offer.test.ts new file mode 100644 index 0000000..a5102f7 --- /dev/null +++ b/browser/src/shared/site-offer.test.ts @@ -0,0 +1,34 @@ +import { describe, expect, test } from "bun:test"; +import { siteOffer } from "./site-offer"; + +describe("siteOffer", () => { + test("nothing for a site with no Activity, whatever is shared", () => { + for (const sharing of ["nothing", "other", "activity"] as const) { + expect(siteOffer(sharing, null)).toBe("none"); + } + }); + + test("nothing while the site's own Activity is what's shared", () => { + for (const status of ["off", "on", "needs-access"] as const) { + expect(siteOffer("activity", status)).toBe("none"); + } + }); + + test("a note when nothing is shared and the site's Activity is on", () => { + expect(siteOffer("nothing", "on")).toBe("note"); + }); + + test("an offer when nothing is shared and the site's Activity is off or can't run", () => { + expect(siteOffer("nothing", "off")).toBe("offer"); + expect(siteOffer("nothing", "needs-access")).toBe("offer"); + }); + + test("an offer while the Default Activity or music kept from another tab is shared, so the site's Activity is still one click away", () => { + expect(siteOffer("other", "off")).toBe("offer"); + expect(siteOffer("other", "needs-access")).toBe("offer"); + }); + + test("an offer while something else is shared and the site's Activity is on but has nothing to share", () => { + expect(siteOffer("other", "on")).toBe("offer"); + }); +}); diff --git a/browser/src/shared/site-offer.ts b/browser/src/shared/site-offer.ts new file mode 100644 index 0000000..fe088e3 --- /dev/null +++ b/browser/src/shared/site-offer.ts @@ -0,0 +1,21 @@ +import type { ActivityStatus } from "./activity-catalog"; + +/** + * What's being shared: nothing; something that isn't the tab's own Activity + * (the Default Activity, or music or video kept from another tab); or the + * tab's own. + */ +export type Sharing = "nothing" | "other" | "activity"; +/** `none`: nothing about the site. `note`: its Activity is on, and nothing is shared. `offer`: a card to turn it on, or to say why it can't run. */ +export type SiteOffer = "none" | "note" | "offer"; + +/** + * What the popup says about the tab's site Activity. Something else is shared + * on a site with nothing running there, so it keeps the offer: the site's + * Activity is still the one to turn on, and Show media presence stays as it + * is. Only the tab's own Activity being shared hides it. + */ +export function siteOffer(sharing: Sharing, status: ActivityStatus | null): SiteOffer { + if (status === null || sharing === "activity") return "none"; + return sharing === "nothing" && status === "on" ? "note" : "offer"; +} diff --git a/browser/src/shared/update-notice.ts b/browser/src/shared/update-notice.ts index c9ef93b..60b53e6 100644 --- a/browser/src/shared/update-notice.ts +++ b/browser/src/shared/update-notice.ts @@ -42,7 +42,7 @@ export function updateNotice( key: `${pair}:${latestDesktop}`, title: t("A newer Parousia Desktop is available"), detail: t( - "This extension is newer than Parousia Desktop {version}. They still work together; update Desktop to get everything the extension offers.", + "This extension is newer than Parousia Desktop {version}. They still work together. Update Desktop to get everything the extension offers.", { version: state.desktopVersion }, ), href: DESKTOP_DOWNLOAD, @@ -53,7 +53,7 @@ export function updateNotice( key: pair, title: t("A newer Parousia extension is available"), detail: t( - "Parousia Desktop {version} is newer than this extension. They still work together; update the extension from your browser's extension page.", + "Parousia Desktop {version} is newer than this extension. They still work together. Update the extension from your browser's extension page.", { version: state.desktopVersion }, ), }; diff --git a/browser/src/shared/views.ts b/browser/src/shared/views.ts index 2102747..9b37c7e 100644 --- a/browser/src/shared/views.ts +++ b/browser/src/shared/views.ts @@ -78,13 +78,13 @@ export function renderOffline( label.textContent = state.status === "incompatible" ? t("Update Parousia Desktop") : t("Get Parousia Desktop"); retry.disabled = checking; - retry.textContent = checking ? t("Checking…") : t("Retry Connection"); + retry.textContent = checking ? t("Checking…") : t("Retry connection"); } /** Under the not-found screen: Discord can still work without Desktop when Discord-RPC-Extension's app is running. */ export function renderDiscordAside(aside: HTMLElement, discord: BridgeState): void { aside.hidden = discord.status !== "connected"; aside.textContent = t( - "Discord-RPC-Extension is running, so Discord can still show your activity without Parousia Desktop.", + "Discord-RPC-Extension is running, so Discord can still show your presence without Parousia Desktop.", ); } diff --git a/desktop/Cargo.lock b/desktop/Cargo.lock index 71b4b85..5a6775e 100644 --- a/desktop/Cargo.lock +++ b/desktop/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "Parousia-Desktop" -version = "1.0.1" +version = "1.0.2" dependencies = [ "dirs", "httparse", @@ -168,9 +168,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" +checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" [[package]] name = "memchr" diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml index 550106d..3cf1448 100644 --- a/desktop/Cargo.toml +++ b/desktop/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "Parousia-Desktop" -version = "1.0.1" +version = "1.0.2" edition = "2024" license = "Apache-2.0" diff --git a/desktop/README.md b/desktop/README.md index 1987749..bbd7c65 100644 --- a/desktop/README.md +++ b/desktop/README.md @@ -1,10 +1,10 @@ -**# desktop** +# desktop -Parousia Desktop is the native app that receives Presence from the browser and publishes it to Discord. It is written in Rust with no async runtime. +Parousia Desktop is the native app that receives presence from the browser and publishes it to Discord. It's written in Rust, with no async runtime. -See `project/architecture.md` for the Platform Adapter Architecture, Communication Protocol, and Desktop Tray, and `project/threat-model.md` for security details. +See `project/architecture.md` for the Platform Adapter Architecture, the Communication Protocol, and the Desktop Tray. See `project/threat-model.md` for security details. -**## Build and Run** +## Build and Run ```bash cargo build @@ -17,17 +17,17 @@ cargo fmt --check ./target/debug/Parousia-Desktop --headless ``` -On Windows, `cargo test` runs against the real thing: named pipes (the control pipe and a fake Discord, including Discord quitting and restarting), the loopback owner check against the TCP table, the registry, and the process tokens of the running machine. `scripts/verify-windows.ps1` then runs the release build (`cargo build --release`) and drives the real notification-area icon and its menu: a second launch, the CLI from a terminal, the control pipe's access list, the port, Settings > Start at login against the real `Run` key, Quit, and a port something else holds. It never touches your own config, Discord, or port 57179 (stop your own Desktop first); the Browser <-> Desktop link on Windows is `bun run desktop:verify` in `browser/`. +On Windows, `cargo test` runs against the real thing: named pipes (the control pipe, and a fake Discord that quits and restarts), the loopback owner check against the TCP table, the registry, and the process tokens of the running machine. `scripts/verify-windows.ps1` then runs the release build and drives the real notification-area icon and its menu. It covers a second launch, the CLI from a terminal, the control pipe's access list, the port, Settings > Start at login against the real `Run` key, Quit, and a port held by something else. It never touches your own config, your Discord, or port 57179, so stop your own Desktop first. The browser-to-Desktop link on Windows is checked by `bun run desktop:verify` in `browser/`. -Release builds are produced by the `Release` workflow when a `vX.Y.Z` tag is pushed to `main`. They are standalone, stripped, and size-optimized (`opt-level = "z"`, LTO), at about 1 MB. +Release builds come from the `Release` workflow, which runs when a `vX.Y.Z` tag is pushed to `main`. They're standalone, stripped, and size-optimized (`opt-level = "z"`, LTO), at about 1 MB. - **Linux:** x86_64 and aarch64, built for `*-unknown-linux-musl` -- **Windows:** x86_64 and aarch64, built with MSVC, no console window +- **Windows:** x86_64 and aarch64, built with MSVC, with no console window - **macOS:** not available yet -Only one Desktop instance runs per user (a second launch says so and exits). Port `57179` must be available; if something else holds it, Desktop says so and exits. +Only one Desktop runs per user. A second launch says so and exits. Port `57179` must be free. If something else holds it, Desktop says so and exits. -**## Browser Connection** +## Browser Connection Browsers connect to: @@ -38,28 +38,28 @@ ws://127.0.0.1:57179/ws Desktop identifies browser clients by their `Origin`. - The Chrome Web Store build is recognized automatically. -- Development builds and every Firefox install (the Add-ons listing included, since Firefox gives each install its own origin) must be allowed once with `Parousia-Desktop allow `. +- Development builds and every Firefox install must be allowed once with `Parousia-Desktop allow `. Firefox gives each install its own origin, the Add-ons listing included. - Refused extensions can also be allowed from the tray's Diagnostics menu. -- Userscripts are disabled by default and require **Allow userscripts**. +- Userscripts are off by default. Turn them on with **Allow userscripts**. - On Linux and Windows, connections from other OS users are refused before anything is read. -There is no pairing step for browser extensions. +Browser extensions have no pairing step. -**## Discord** +## Discord -Desktop publishes the active browser Presence through the Discord app running on the same computer. +Desktop publishes the active browser presence through the Discord app on the same computer. -It supports Discord installed normally through its local IPC socket (a named pipe on Windows), including Flatpak and Snap installations. Only IPC owned by the current user is used: a socket owned by another user, or a pipe whose server process runs as another user, is never connected to. +It works with Discord installed normally, through its local IPC socket (a named pipe on Windows), including Flatpak and Snap installs. Only IPC owned by the current user is used. A socket owned by another user, or a pipe whose server runs as another user, is never connected to. -When multiple browsers are connected, the most recently changed Activity is shown. When it clears, another connected browser can take over. +When several browsers are connected, the most recently changed Activity is shown. When it clears, another connected browser can take over. -Desktop only connects to Discord while there is something to show. Changes within one Activity (the next video, a new track) show at once, unless something was shown less than 2 seconds before: then only the newest waits for those 2 seconds to pass, so a burst shows its first and its last, and a steady stream is never more than 2 seconds behind. Moving to another Activity, or clearing, always shows at once. Discord's own update limit is kept to on top of that. +Desktop connects to Discord only while there's something to show. Changes within one Activity (the next video, a new track) show at once, unless something was shown less than 2 seconds earlier. Then only the newest change waits for those 2 seconds to pass. A burst shows its first and last changes, and a steady stream is never more than 2 seconds behind. Moving to another Activity, or clearing, always shows at once. Discord's own update limit still applies on top of this. -`PAROUSIA_DISCORD_IPC_DIR` can override the directory used to find Discord's IPC socket on Linux and macOS, and `PAROUSIA_DISCORD_IPC_PIPE` the pipe name (up to its number, default `\\.\pipe\discord-ipc-`) on Windows. Discord quitting or restarting is noticed at once on every platform. +`PAROUSIA_DISCORD_IPC_DIR` overrides the directory of Discord's IPC socket on Linux and macOS. `PAROUSIA_DISCORD_IPC_PIPE` overrides the pipe name on Windows (up to its number, default `\\.\pipe\discord-ipc-`). Discord quitting or restarting is noticed at once on every platform. -**## Commands** +## Commands -These commands communicate with the running Desktop: +These commands talk to the running Desktop: | Command | Description | | ------------------------------------------ | --------------------------------------------------------------------------------- | @@ -71,23 +71,15 @@ These commands communicate with the running Desktop: Add `--json` for machine-readable output. -On Windows the commands talk to the running Desktop over a named pipe that only this user can open, and print into the terminal they were typed in (the release exe has no console window of its own). The tray menu has the same controls. +On Windows, the commands talk to the running Desktop over a named pipe that only this user can open. They print into the terminal they were typed in, since the release exe has no console window of its own. The tray menu has the same controls. -**## Logging** +## Logging Desktop is silent by default and keeps no event history. -Debug logging can be enabled for the current run with: +Debug logging can be turned on for the current run with `Parousia-Desktop --debug`, or from the tray, the `status` interface, or the console. Startup errors are always reported. -```bash -Parousia-Desktop --debug -``` - -or through the tray, `status` interface, or console. - -Startup errors are always reported. - -**## Files** +## Files Configuration is stored in: @@ -99,30 +91,28 @@ Example: ```json { - "allowedOrigins": ["chrome-extension://", "moz-extension://"], - "allowUserscripts": false, - "discordClientId": "" + "allowedOrigins": ["chrome-extension://", "moz-extension://"], + "allowUserscripts": false, + "discordClientId": "" } ``` -All keys are optional. Unknown keys or invalid values cause Desktop to stop at startup rather than silently applying a bad configuration. +All keys are optional. Unknown keys and invalid values stop Desktop at startup, so a bad configuration is never applied silently. -The command socket is stored under `$XDG_RUNTIME_DIR/parousia/desktop.sock` on Linux, or in the data directory when no runtime directory is available, with `desktop.lock` beside it: whichever Desktop holds the lock is the one that runs. On Windows it is the named pipe `\\.\pipe\parousia-desktop-`, whose access list names only you. Browsers never use it. +The command socket is `$XDG_RUNTIME_DIR/parousia/desktop.sock` on Linux, or in the data directory when no runtime directory exists. `desktop.lock` sits beside it, and whichever Desktop holds the lock is the one that runs. On Windows, the socket is the named pipe `\\.\pipe\parousia-desktop-`, whose access list names only you. Browsers never use it. -`PAROUSIA_DATA_DIR` replaces the data directory (the end-to-end checks use it so a test run never touches a real config). +`PAROUSIA_DATA_DIR` replaces the data directory. The end-to-end checks use it, so a test run never touches a real config. -**## Tray** +## Tray The tray is optional. - **Linux:** StatusNotifierItem -- **Windows:** notification-area icon, with Settings > **Start at login** (an entry under your own `Run` key, the one Task Manager's Startup tab lists; Windows starts it with the tray, and nothing else is installed) +- **Windows:** notification-area icon. Settings > **Start at login** adds an entry under your own `Run` key, the one Task Manager's Startup tab lists. Windows then starts Desktop with the tray, and nothing else is installed. - **macOS:** not available yet -The tray provides status, Discord Presence, connected browsers, diagnostics, settings, notifications, and quit controls. - -Desktop continues working without a tray host. The command interface and browser dashboard provide the same functionality. +The tray shows status, Discord presence, connected browsers, diagnostics, settings, and notifications, and it has a quit control. -`--headless` disables the tray. +Desktop works without a tray host. The command interface and the browser dashboard offer the same functions. `--headless` turns the tray off. Tray icons are generated from `assets/brand/parousia-rounded.webp` into `assets/tray-{32,48}.rgba`. diff --git a/desktop/src/adapters/discord/mod.rs b/desktop/src/adapters/discord/mod.rs index 3c575f2..36ce109 100644 --- a/desktop/src/adapters/discord/mod.rs +++ b/desktop/src/adapters/discord/mod.rs @@ -14,6 +14,8 @@ //! and right away whenever the Activity changes. Nothing to show, no tries. //! - Discord quitting or restarting ends the connection; the current //! Activity is shown again once Discord is back. +//! - A write Discord doesn't take within 5 seconds (it has stopped reading) +//! ends the connection and is retried like a restart. //! - Discord accepts 5 activity updates per 20 seconds. Faster changes are //! coalesced: only the latest is sent once the window allows. (Rapid //! changes within one Activity rarely get that far: `coalesce` holds them diff --git a/desktop/src/main.rs b/desktop/src/main.rs index 1446475..feb0232 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -111,12 +111,12 @@ fn bind_failure(err: &std::io::Error, holder: platform::Owner) -> String { let address = server::ADDRESS; if err.kind() == std::io::ErrorKind::AddrInUse && holder == platform::Owner::OtherUser { format!( - "port {} is held by a program another user on this computer runs, so Parousia Desktop can't start, and Parousia in your browsers may be sending it what you're doing instead. Find out what's using {address}, or ask an administrator, before using Parousia here.", + "port {} is held by a program run by another user on this computer. Parousia Desktop can't start, and browsers running Parousia may send it what you're doing instead. Find out what's using {address}, or ask an administrator, before using Parousia here.", server::DEFAULT_PORT ) } else if err.kind() == std::io::ErrorKind::AddrInUse { format!( - "port {} is already in use, so Parousia Desktop can't start. Close whatever is using {address} (often another copy of Parousia Desktop that a previous run left behind), then start it again.", + "port {} is already in use, so Parousia Desktop can't start. Close what's using {address} (often an earlier copy of Parousia Desktop), then start it again.", server::DEFAULT_PORT ) } else { @@ -240,7 +240,7 @@ mod tests { ); assert!(message.contains("57179")); assert!(message.contains("already in use")); - assert!(message.contains("Close whatever is using 127.0.0.1:57179")); + assert!(message.contains("Close what's using 127.0.0.1:57179")); } #[test] diff --git a/desktop/src/platform/linux/tray/mod.rs b/desktop/src/platform/linux/tray/mod.rs index f6b0d1b..f013688 100644 --- a/desktop/src/platform/linux/tray/mod.rs +++ b/desktop/src/platform/linux/tray/mod.rs @@ -116,9 +116,7 @@ pub fn run(hub: Arc) -> Exit { && message.reply_serial == register_serial && hub.debug() => { - println!( - "Parousia Desktop: no system tray is running yet; the icon appears when one starts" - ); + println!("Parousia Desktop: no system tray yet. The icon appears when one starts."); } _ => {} } diff --git a/desktop/src/platform/unix/discord.rs b/desktop/src/platform/unix/discord.rs index 2794e99..6e0b412 100644 --- a/desktop/src/platform/unix/discord.rs +++ b/desktop/src/platform/unix/discord.rs @@ -14,11 +14,15 @@ use std::io::{self, Write}; use std::os::unix::fs::{FileTypeExt, MetadataExt}; use std::os::unix::net::UnixStream; use std::path::PathBuf; +use std::time::Duration; use crate::adapters::discord::ipc::{Deliver, Incoming, encode, read_frame}; use super::user; +/// A write to Discord that takes longer than this means it has stopped listening. +const WRITE_TIMEOUT: Duration = Duration::from_secs(5); + /// Where to look for Discord. #[derive(Debug, Clone)] pub struct Endpoints { @@ -126,6 +130,9 @@ pub fn open(endpoints: &Endpoints, deliver: Deliver) -> io::Result { { continue; } + if stream.set_write_timeout(Some(WRITE_TIMEOUT)).is_err() { + continue; + } let mut reader = stream.try_clone()?; std::thread::Builder::new() .name("discord-ipc".into()) @@ -261,4 +268,44 @@ mod tests { "{opened} opened, {refused} refused" ); } + + /// A Discord that accepts the connection and never reads, as a stopped or + /// hung one does: the write that can't finish must fail, so the adapter + /// drops the connection and retries instead of waiting on it for good. + #[test] + fn a_write_to_a_discord_that_stopped_reading_times_out() { + use crate::adapters::discord::ipc::{MAX_FRAME, OP_FRAME}; + use std::os::unix::net::UnixListener; + use std::sync::mpsc; + + let dir = crate::app::config::tests::temp_dir("discord-stalled"); + let listener = UnixListener::bind(dir.join("discord-ipc-0")).unwrap(); + let (release, held) = mpsc::channel::<()>(); + std::thread::spawn(move || { + let _silent = listener.accept(); + let _ = held.recv(); + }); + + let (done, result) = mpsc::channel(); + let endpoints = Endpoints::at(dir.clone()); + std::thread::spawn(move || { + let mut link = open(&endpoints, Box::new(|_| {})).unwrap(); + let frame = vec![b'x'; MAX_FRAME]; + let error = loop { + if let Err(error) = link.send(OP_FRAME, &frame) { + break error; + } + }; + let _ = done.send(error.kind()); + }); + + let ended = result.recv_timeout(WRITE_TIMEOUT * 3); + drop(release); + std::fs::remove_dir_all(dir).ok(); + let kind = ended.expect("the write never gave up on a Discord that stopped reading"); + assert!(matches!( + kind, + io::ErrorKind::WouldBlock | io::ErrorKind::TimedOut + )); + } } diff --git a/desktop/src/platform/windows/control.rs b/desktop/src/platform/windows/control.rs index 49a10eb..0bf58a8 100644 --- a/desktop/src/platform/windows/control.rs +++ b/desktop/src/platform/windows/control.rs @@ -148,7 +148,7 @@ fn request(name: &str, request: &ControlRequest) -> io::Result if !pipe.server_process_id().is_some_and(is_this_user) { return Err(io::Error::new( io::ErrorKind::PermissionDenied, - "Desktop's pipe is held by a process of another Windows user, so nothing was sent to it", + "Another Windows user's process holds Desktop's pipe, so nothing was sent", )); } let mut io = pipe.io_until(Instant::now() + Duration::from_secs(5)); diff --git a/project/architecture.md b/project/architecture.md index 57f876f..99f016d 100644 --- a/project/architecture.md +++ b/project/architecture.md @@ -26,6 +26,8 @@ Activities are compiled at build time from two external repositories (`browser/a - **Native Activities** (`parousia-project/activities`): Read URLs/titles or use Parousia's built-in `collector.ts` to poll Media Session (`