[Bug]: TimezoneId is not applied to service workers
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 64/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, playwright, typescript
- Lĩnh vực
- backend, testing-qa
Hướng nghiên cứu
Read packages/playwright-core/src/server/chromium/crPage.ts around the timezone setup and compare it with service worker startup in packages/playwright-core/src/server/chromium/crServiceWorker.ts. Start by reproducing the issue with the linked minimal test, then find or add a regression test covering a worker started without an open page. Done when the worker uses the configured timezoneId from its first statement and the regression test passes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version
1.65.0 (latest release tested)
Steps to reproduce
Minimal reproduction, using only Playwright and a minimal Manifest V3 extension.
git clone --branch service-worker-timezone --single-branch https://github.com/vitalets/playwright-issues.git
cd playwright-issues
npm ci
npx playwright install chromium
# Adjust timezoneId in test/timezone.spec.ts if needed.
npm test
Choose a timezoneId different from your system timezone. The example uses Europe/Madrid; if your system already uses Madrid, change the timezoneId variable in test/timezone.spec.ts to Asia/Tokyo (no other changes are needed). Matching timezones mask the bug.
The test verifies the configured timezone in an ordinary page, then loads an extension whose first statement records its worker's timezone and parses 2030-01-01T23:00. No extension page is opened, and no timezone environment variable is set.
Expected behavior
The service worker uses the configured timezoneId from its first statement. Its timezone and parsed date match the page's values.
Actual behavior
The page uses the configured timezone, but the worker retains the system timezone. On my Madrid-configured machine, changing the example to Asia/Tokyo produces:
- "timezone": "Asia/Tokyo"
+ "timezone": "Europe/Madrid"
- "localDate": "2030-01-01T14:00:00.000Z"
+ "localDate": "2030-01-01T22:00:00.000Z"
Additional context
Reproduced with bundled Chromium 158.0.8127.18 on macOS. No clock mocking or third-party helpers are involved.
Both web extensions and regular websites are affected:
- Web extension: the linked reproduction loads an extension without opening an extension page. Its worker starts with the system timezone instead of the configured timezone.
- Regular website: in a separate local experiment, I registered a service worker, closed the persistent browser context, reopened the same profile with the same timezone setting, and started the registered worker using CDP
ServiceWorker.startWorker, without reopening the site. Its first statement also recorded the browser default timezone instead of the configured timezone.
Initial registration while the website page was open used Madrid correctly. An open page can mask the problem when its timezone override affects the worker's shared renderer process.
Page initialization applies the context's timezoneId, while service-worker initialization resumes execution without applying it.
Environment
Relevant output from npx envinfo --preset playwright:
System:
OS: macOS 26.6.2
CPU: (10) arm64 Apple M1 Pro
Binaries:
Node: 24.16.0
npm: 11.21.1
npmPackages:
@playwright/test: 1.65.0 => 1.65.0
- Ngôn ngữ chính
- TypeScript
- Star
- 99.1k
- Fork
- 6.8k
- Merge trung bình
- 17 giờ 6 phút
- Pull request đã merge (30 ngày)
- 306
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/playwright
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
microsoft/playwright#43987 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
microsoft/playwright#43986 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Embedded number/range inputs contribute their `value` attribute, not their current value, to accessible namesCó thể đã có người làm @lazerg đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
microsoft/playwright#43984 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
microsoft/playwright#43981 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
microsoft/playwright#43969 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/playwright
Issue tương tự
-
FR: Support CJK brackets, symbols and full-width markers in footnoteHeuristics (EBPAJ support)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
readest/readest#7413 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
content triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eliasstravik/herdr-projects#788 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Ability to edit tagsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày