RSSHub/lib/utils
Tony cfcdc34e1f
refactor: replace playwright with patchright (#21976)
* refactor: use patchwright

* refactor: migrate setRequestInterception and waitUntil

* fix: overwrite ua

* refactor: drop puppeteer cookie/requestfinished shims

Migrate page.cookies/setCookie and browser.cookies/setCookie call sites to the native context APIs (page.context().cookies/addCookies), rewrite requestfinished handlers to await request.response() instead of consuming the synchronous puppeteer-shaped payload, and remove the now-redundant browser.close context-cleanup wrapper. Playwright already handles all of these natively; the shims existed only for the puppeteer -> playwright migration.

* refactor: remove page.authenticate, page.setUserAgent,  browser.newPage(), browser.userAgent() shims

update cookie utility tests

* refactor: replace browser instance with context in Playwright usage across multiple routes

- Updated all instances of `browser` to `context` in Playwright-related functions for consistency and improved resource management.
- Ensured proper closure of context after operations to prevent memory leaks.
- Adjusted request interception methods to utilize the new context variable.

* fix: direct type import

* refactor: remove Puppeteer compatibility layers and unify page handling with Playwright

* fix: test case

* chore: bump patchright to v1.60.0

* chore: pin patchright to 1.59.1

nft can't resolve browser.json due to https://github.com/microsoft/playwright/pull/40093

* chore: pin to node 24.15 for playwright

browser install on node 24.16 stucks due to https://github.com/microsoft/playwright/issues/40724

* fix: update patchright and patchright-core to version 1.60.2 and adjust minify-docker.js for compatibility

* fix: import BrowserContext from patchright
2026-06-07 02:43:20 +08:00
..
cache fix(cache): call JSON.stringify when storing value in cache.tryGet (#20671) 2026-05-07 01:26:11 +08:00
otel refactor: deploy all routes to Cloudflare Workers (#20809) 2026-01-04 17:33:55 +08:00
proxy refactor: migrate browser automation to Playwright (#21901) 2026-05-04 21:16:18 +08:00
request-rewriter refactor: migrate browser automation to Playwright (#21901) 2026-05-04 21:16:18 +08:00
cache.test.ts fix(cache): call JSON.stringify when storing value in cache.tryGet (#20671) 2026-05-07 01:26:11 +08:00
camelcase-keys.spec.ts refactor: fix lint issue (#18963) 2025-04-29 03:00:16 +08:00
camelcase-keys.ts chore: add eslint-plugin-regexp (#22189) 2026-06-05 20:04:39 +08:00
common-config.charset.test.ts style: auto format 2026-04-14 15:15:05 +00:00
common-config.test.ts style: auto format 2026-04-14 15:15:05 +00:00
common-config.ts chore: add eslint-plugin-regexp (#22189) 2026-06-05 20:04:39 +08:00
common-utils.test.ts feat(tests): add comprehensive unit tests for various utility functions and views (#20779) 2025-12-29 17:34:48 +08:00
common-utils.ts feat: disable IPv6 (#21719) 2026-04-13 23:45:08 +08:00
debug-info.ts
directory-import.test.ts feat: esm directory import (#21428) 2026-03-18 15:15:28 +08:00
directory-import.ts feat: esm directory import (#21428) 2026-03-18 15:15:28 +08:00
directory-import.worker.ts feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
git-hash.test.ts feat(tests): add comprehensive unit tests for various utility functions and views (#20779) 2025-12-29 17:34:48 +08:00
git-hash.ts style: auto format 2025-11-27 02:55:46 +00:00
got.test.ts style: auto format 2026-04-14 15:15:05 +00:00
got.ts chore(deps-dev): bump got from 14.6.6 to 15.0.0 (#21591) 2026-04-10 00:57:30 +08:00
header-generator.mock.test.ts feat(tests): add comprehensive unit tests for various utility functions and views (#20779) 2025-12-29 17:34:48 +08:00
header-generator.test.ts feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
header-generator.ts test(header-generator): improve header validation (#21492) 2026-03-24 23:37:28 +08:00
helpers.test.ts feat(tests): add comprehensive unit tests for various utility functions and views (#20779) 2025-12-29 17:34:48 +08:00
helpers.ts style: auto format 2025-11-27 02:55:46 +00:00
is-worker.ts feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
is-worker.worker.ts feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
logger.test.ts feat(tests): add comprehensive unit tests for various utility functions and views (#20779) 2025-12-29 17:34:48 +08:00
logger.ts style: replace unicorn/no-for-loop w/ typescript/prefer-for-of (#20798) 2026-01-02 09:42:24 +08:00
logger.worker.ts feat: deploy RSSHub to Cloudflare Workers (#20804) 2026-01-04 09:22:05 +08:00
md5.test.ts style: auto format 2025-11-27 02:55:46 +00:00
md5.ts refactor: fix lint issue (#18963) 2025-04-29 03:00:16 +08:00
ofetch.test.ts feat(tests): add comprehensive unit tests for various utility functions and views (#20779) 2025-12-29 17:34:48 +08:00
ofetch.ts fix(ofetch): use late-binding fetch in ofetch to ensure request-rewriter intercepts bundled builds (#21518) 2026-03-26 21:24:46 +08:00
parse-date.test.ts fix(utils): refactor parseRelativeDate to support dynamic reference (#21054) 2026-02-06 21:44:49 +08:00
parse-date.ts chore: add eslint-plugin-regexp (#22189) 2026-06-05 20:04:39 +08:00
playwright-utils.test.ts refactor: replace playwright with patchright (#21976) 2026-06-07 02:43:20 +08:00
playwright-utils.ts refactor: replace playwright with patchright (#21976) 2026-06-07 02:43:20 +08:00
playwright.mock.test.ts refactor: replace playwright with patchright (#21976) 2026-06-07 02:43:20 +08:00
playwright.test.ts refactor: replace playwright with patchright (#21976) 2026-06-07 02:43:20 +08:00
playwright.ts refactor: replace playwright with patchright (#21976) 2026-06-07 02:43:20 +08:00
playwright.worker.ts refactor: replace playwright with patchright (#21976) 2026-06-07 02:43:20 +08:00
puppeteer-utils.ts refactor: migrate browser automation to Playwright (#21901) 2026-05-04 21:16:18 +08:00
readable-social.test.ts feat(tests): add comprehensive unit tests for various utility functions and views (#20779) 2025-12-29 17:34:48 +08:00
readable-social.ts style: auto format 2025-11-27 02:55:46 +00:00
render.ts refactor: replace art template with jsx (#20777) 2025-12-29 12:27:32 +08:00
request-rewriter.test.ts fix(ua): ensure header-generator and custom ua are effective with each other (#21546) 2026-03-29 22:47:56 +08:00
rss-parser.test.ts chore(deps-dev): bump tsdown from 0.21.9 to 0.21.10 (#21810) 2026-04-29 05:09:46 +08:00
rss-parser.ts style: auto format 2025-11-27 02:55:46 +00:00
timezone.test.ts feat(tests): add comprehensive unit tests for various utility functions and views (#20779) 2025-12-29 17:34:48 +08:00
timezone.ts refactor: fix lint issue (#18963) 2025-04-29 03:00:16 +08:00
valid-host.test.ts style: auto format 2025-11-27 02:55:46 +00:00
valid-host.ts chore: add eslint-plugin-regexp (#22189) 2026-06-05 20:04:39 +08:00
wait.test.ts style: auto format 2025-11-27 02:55:46 +00:00
wait.ts
wechat-mp.test.ts style: use oxlint-plugin-eslint for unimplemented eslint rules 2026-04-02 05:29:27 +08:00
wechat-mp.ts chore: add eslint-plugin-regexp (#22189) 2026-06-05 20:04:39 +08:00