Skip to content

Conversation

@samuelmaddock
Copy link
Member

@samuelmaddock samuelmaddock commented Feb 19, 2025

Description of Change

Fixes an issue with chrome extensions in which calling new Worker('chrome-extension://...') would fail with ERR_UNKNOWN_URL_SCHEME. Below is a net log snippet of the problem.

42: URL_REQUEST
chrome-extension://likgccmbimhjbgkjambclfkhldnlhbnn/js/dictionary/dictionary-database-worker-main.js
Start Time: 2025-02-18 19:52:14.572

t=298 [st=0] +CORS_REQUEST  [dt=0]
              --> cors_preflight_policy = "consider_preflight"
              --> headers = "Accept: */*\r\n\r\n"
              --> is_revalidating = false
              --> method = "GET"
              --> url = "chrome-extension://likgccmbimhjbgkjambclfkhldnlhbnn/js/dictionary/dictionary-database-worker-main.js"
t=298 [st=0]    CHECK_CORS_PREFLIGHT_REQUIRED
                --> preflight_required = false
t=298 [st=0]   +REQUEST_ALIVE  [dt=0]
                --> priority = "IDLE"
                --> traffic_annotation = 72087791
                --> url = "chrome-extension://likgccmbimhjbgkjambclfkhldnlhbnn/js/dictionary/dictionary-database-worker-main.js"
t=298 [st=0]      NETWORK_DELEGATE_BEFORE_URL_REQUEST  [dt=0]
t=298 [st=0]     +URL_REQUEST_START_JOB  [dt=0]
                  --> initiator = "chrome-extension://likgccmbimhjbgkjambclfkhldnlhbnn"
                  --> load_flags = 131072 (CAN_USE_SHARED_DICTIONARY)
                  --> method = "GET"
                  --> network_isolation_key = "chrome-extension://likgccmbimhjbgkjambclfkhldnlhbnn chrome-extension://likgccmbimhjbgkjambclfkhldnlhbnn"
                  --> request_type = "other"
                  --> site_for_cookies = "SiteForCookies: {site=chrome-extension://likgccmbimhjbgkjambclfkhldnlhbnn; schemefully_same=true}"
                  --> url = "chrome-extension://likgccmbimhjbgkjambclfkhldnlhbnn/js/dictionary/dictionary-database-worker-main.js"
t=298 [st=0]     -URL_REQUEST_START_JOB
                  --> net_error = -302 (ERR_UNKNOWN_URL_SCHEME)
t=298 [st=0]      URL_REQUEST_DELEGATE_RESPONSE_STARTED  [dt=0]
t=298 [st=0] -CORS_REQUEST
t=298 [st=0] -URL_REQUEST_DELEGATE_RESPONSE_STARTED
t=298 [st=0] -REQUEST_ALIVE
              --> net_error = -302 (ERR_UNKNOWN_URL_SCHEME)

Here's the same code where it's added in Chrome: https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/chrome_content_browser_client.cc;l=6210-6218;drc=798b98d70313e6a55bcf9cc85bc7ca7d42ca6d23

relates to samuelmaddock/electron-browser-shell#106

Checklist

Release Notes

Notes: Fixes web worker scripts failing to load for chrome extensions.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Feb 19, 2025
@samuelmaddock samuelmaddock added semver/patch backwards-compatible bug fixes target/32-x-y PR should also be added to the "32-x-y" branch. target/33-x-y PR should also be added to the "33-x-y" branch. target/34-x-y PR should also be added to the "34-x-y" branch. target/35-x-y PR should also be added to the "35-x-y" branch. labels Feb 19, 2025
@samuelmaddock samuelmaddock merged commit b50066f into main Feb 19, 2025
77 checks passed
@samuelmaddock samuelmaddock deleted the fix/extension-workers branch February 19, 2025 18:08
@release-clerk
Copy link

release-clerk bot commented Feb 19, 2025

Release Notes Persisted

Fixes web worker scripts failing to load for chrome extensions.

@trop
Copy link
Contributor

trop bot commented Feb 19, 2025

I have automatically backported this PR to "35-x-y", please check out #45708

@trop trop bot added in-flight/35-x-y and removed target/35-x-y PR should also be added to the "35-x-y" branch. labels Feb 19, 2025
@trop
Copy link
Contributor

trop bot commented Feb 19, 2025

I have automatically backported this PR to "32-x-y", please check out #45709

@trop
Copy link
Contributor

trop bot commented Feb 19, 2025

I have automatically backported this PR to "34-x-y", please check out #45710

@trop
Copy link
Contributor

trop bot commented Feb 19, 2025

I have automatically backported this PR to "33-x-y", please check out #45711

@samuelmaddock
Copy link
Member Author

my bad, I accidentally merged this early 😬 lmk if folks have additional feedback for this

@trop trop bot added in-flight/34-x-y in-flight/33-x-y and removed target/32-x-y PR should also be added to the "32-x-y" branch. target/34-x-y PR should also be added to the "34-x-y" branch. target/33-x-y PR should also be added to the "33-x-y" branch. in-flight/32-x-y labels Feb 19, 2025
@trop trop bot added merged/32-x-y PR was merged to the "32-x-y" branch. merged/33-x-y PR was merged to the "33-x-y" branch. merged/35-x-y PR was merged to the "35-x-y" branch. merged/34-x-y PR was merged to the "34-x-y" branch. and removed in-flight/33-x-y in-flight/35-x-y in-flight/34-x-y labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/32-x-y PR was merged to the "32-x-y" branch. merged/33-x-y PR was merged to the "33-x-y" branch. merged/34-x-y PR was merged to the "34-x-y" branch. merged/35-x-y PR was merged to the "35-x-y" branch. new-pr 🌱 PR opened recently semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants