Skip to content

Refactor i18n title matching to improve Chromium-based PiP compatibility#48

Open
BeardTech wants to merge 1 commit intoRafostar:mainfrom
BeardTech:main
Open

Refactor i18n title matching to improve Chromium-based PiP compatibility#48
BeardTech wants to merge 1 commit intoRafostar:mainfrom
BeardTech:main

Conversation

@BeardTech
Copy link

This PR refactors PiP window detection by moving from mostly hardcoded/translations-based checks to a JSON-driven matcher system, with broader internationalization
coverage for both Firefox and Chromium-based browsers.

It also consolidates and incorporates ideas/fixes that were previously proposed in other existing PRs, and adapts them into this new implementation.

What changed

  • Reworked title matching in extension.js:
    • Added JSON-backed exact title matching.
    • Added title normalization (spaces, NBSP handling, trimming).
    • Kept static fallbacks and existing special-case handling.
  • Added pip-title-matchers.json:
    • Structured with separate firefox and chrome nodes.
    • Includes many localized PiP titles.
  • Replaced translate.sh with update_translations.sh:
    • Supports generating/updating matcher data from upstream translation sources.
    • Supports partial updates with:
      • --firefox-only
      • --chrome-only
  • Updated packaging in bundle.sh to include pip-title-matchers.json.
  • Updated README.md with the new translation/update workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant