Read Frog

Kiểm soát trang web và Site Rules

Dùng blacklist/whitelist và JSON theo site cho URL, selector, bố cục, ngưỡng và CSS.

Tính năngVị tríMục đích
Site ControlCài đặt → ChungCho phép hoặc chặn toàn extension theo host.
Site RulesCài đặt → Site RulesĐổi cách phân tích, bố cục, lọc và CSS của trang khớp.

Site Control là chính sách chạy. Dùng Site Rules khi extension chạy nhưng chọn sai node, phá inline text, dịch code hoặc cần CSS riêng.

Host và URL patterns

Blacklist chạy ngoài danh sách; whitelist chỉ chạy trong danh sách. example.com gồm subdomain nhưng không nhận path/wildcard.

Site Rules bỏ qua query string và hỗ trợ:

PatternKhớp
github.comHTTP/HTTPS của host
*.example.comdomain gốc và subdomain
docs.example.com/guides/*path cụ thể
https://example.com/*chỉ HTTPS
www.amazon.*host ở nhiều TLD
javdb*.comhost có chữ sau javdb

Scheme có thể là http, https, *; không cho port rõ ràng. Dùng excludeMatches để loại trừ.

Ưu tiên và gộp

Các rule built-in khớp và bật được áp dụng trước, user rule sau. Có thể tắt built-in theo ID.

  • Mảng selector đi qua base, .add, .remove theo thứ tự.
  • minCharacters/minWords dùng giá trị khớp cuối cùng.
  • injectedCssinjectedCss.add được nối lại.
  • Pattern/selector sai bị bỏ qua với cảnh báo.

Mảng không đơn giản bị thay thế: .remove để hoàn tác, .add để mở rộng.

Trường và ví dụ an toàn

Mỗi rule cần id duy nhất và matches. Có thể dùng excludeSelectors, includeSelectors, forceBlockSelectors, forceInlineSelectors, preserveTextSelectors, minCharacters, minWords, injectedCss.

[
  {
    "id": "example-docs",
    "description": "Translate article copy but leave navigation and code untouched.",
    "matches": ["docs.example.com/*"],
    "excludeSelectors": ["nav", "pre", "code", "[aria-label='Breadcrumb']"],
    "includeSelectors": ["main article"],
    "forceBlockSelectors": ["article p", "article li"],
    "preserveTextSelectors": [".product-name", ".command-name"],
    "minCharacters": 2,
    "minWords": 1,
    "injectedCss": ".read-frog-translated-content-wrapper { max-width: 100%; }"
  }
]

Thử trên một host hẹp, lưu và reload trước khi mở rộng pattern. Ưu tiên thuộc tính ổn định thay vì class sinh tự động.

[
  {
    "id": "example-docs-adjustment",
    "matches": ["docs.example.com/*"],
    "excludeSelectors.add": [".sidebar-ad"],
    "excludeSelectors.remove": [".article-summary"],
    "forceInlineSelectors.add": [".term-with-tooltip"]
  }
]

Editor kiểm tra JSON, schema, ID trùng, selector, pattern và kích thước. Giới hạn: 200 user rules, 65.536 ký tự JSON, 8.192 cho mỗi CSS.

CSS được chèn vào mọi trang khớp. Giữ pattern hẹp và không ẩn điều khiển đăng nhập, bảo mật hay tài khoản.

On this page