-
-
Notifications
You must be signed in to change notification settings - Fork 7k
fix(worker): resolve WebKit compat with inline workers by deferring blob URL revocation #20460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
patak-dev
merged 5 commits into
main
from
copilot/fix-b5bf4aa1-af84-45b4-93a5-52522fe1cad4
Jul 25, 2025
Merged
fix(worker): resolve WebKit compat with inline workers by deferring blob URL revocation #20460
patak-dev
merged 5 commits into
main
from
copilot/fix-b5bf4aa1-af84-45b4-93a5-52522fe1cad4
Jul 25, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rker content Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Copilot finished work on behalf of
sapphi-red
July 22, 2025 13:42
sapphi-red
reviewed
Jul 22, 2025
…atibility Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Copilot finished work on behalf of
sapphi-red
July 22, 2025 14:04
sapphi-red
reviewed
Jul 22, 2025
sapphi-red
reviewed
Jul 22, 2025
…ibility Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Copilot finished work on behalf of
sapphi-red
July 22, 2025 14:13
sapphi-red
approved these changes
Jul 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed that #19238 works with this change.
patak-dev
approved these changes
Jul 25, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Inline workers generated by Vite were incompatible with Playwright's WebKit (and potentially other WebKit-based browsers) due to premature Blob URL revocation. The issue occurred because Vite's
WorkerWrapper
code immediately revoked the Blob URL in afinally
block, invalidating it before WebKit could properly initialize the worker.This caused worker initialization failures in WebKit environments, particularly affecting testing with Playwright.
Solution
Following @sapphi-red's suggestion in #19238, this fix moves the URL revocation logic inside the worker script for classic workers (similar to how module workers already handled it), allowing the Blob URL to remain valid throughout the worker's lifecycle.
Changes made:
(self.URL || self.webkitURL).revokeObjectURL(self.location.href);
at the start of their scriptfinally
block: No more immediate URL revocation that was breaking WebKitBefore (classic workers):
After (classic workers):
Module workers were already handled correctly and remain unchanged.
Testing
Related
Closes #19238
Closes #19565
Co-authored-by: sapphi-red 49056869+sapphi-red@users.noreply.github.com
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
vite.dev
/home/REDACTED/.cache/playwright-bin/chromium_headless_shell-1181/chrome-linux/headless_shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AcceptCHFrame,AutoExpandDetailsElement,AvoidUnnecessaryBeforeUnloadCheckSync,CertificateTransparencyComponentUpdater,DestroyProfileOnBrowserClose,DialMediaRouteProvider,ExtensionManifestV2Disabled,GlobalMediaControls,HttpsUpgrades,ImprovedCookieControls,LazyFrameLoading,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --force-color-profile=srgb --metrics-recording-only --no-first-run --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --disable-search-engine-choice-screen --unsafely-disable-devtools-self-xss-warnings --edge-skip-compat-layer-relaunch --enable-automation --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-sandbox --disable-setuid-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-YUN3Kl --remote-debugging-pipe --no-startup-window
(dns block)workers.cloudflare.com
node (vitest 3)
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.