Skip to content

fix: loading dedicated/shared worker scripts over custom protocol#20625

Merged
codebytere merged 4 commits into
masterfrom
robo/fix_worker_custom_protocol
Jul 28, 2020
Merged

fix: loading dedicated/shared worker scripts over custom protocol#20625
codebytere merged 4 commits into
masterfrom
robo/fix_worker_custom_protocol

Conversation

@deepak1556

@deepak1556 deepak1556 commented Oct 18, 2019

Copy link
Copy Markdown
Member

Description of Change

Closes #20557.
Closes #24715.

This is a two part fix,

Part I: Fix crash when loading over data: protocol mentioned in the above issue

This issue will appear only with nodeintegration enabled in the worker. Adds patch worker_feat_add_hook_to_notify_script_ready.patch that explains the root cause of this issue, I am gonna try upstreaming this, will see how it goes. The access to global properties from Node.js happens in node::MaybeInitializeContext which modifies the global object for primordials.

Part II: Cannot load worker scripts over custom protocol

After https://chromium-review.googlesource.com/c/chromium/src/+/1798250 we need to explicitly register custom URLLoaderFactories for dedicated/shared workers.

Checklist

Release Notes

Notes:

  • fix loading shared worker scripts over custom protocol
  • fix crash when loading worker scripts with nodeIntegration enabled

@deepak1556
deepak1556 requested review from a team and zcbenz October 18, 2019 01:27
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Oct 18, 2019
@deepak1556

Copy link
Copy Markdown
Member Author

WIP to add some tests.

@deepak1556
deepak1556 force-pushed the robo/fix_worker_custom_protocol branch from 1e20e47 to 467e29f Compare October 18, 2019 02:21
@deepak1556
deepak1556 force-pushed the robo/fix_worker_custom_protocol branch from d5db43a to a8cbcfe Compare April 1, 2020 04:09
@Dan-Shields

Copy link
Copy Markdown

Wouldn't know where to begin with writing the tests, but would love to see this merged, especially as v6 is now not supported and was the last version where shared workers worked!

@krisdages

krisdages commented Jun 12, 2020

Copy link
Copy Markdown

I thought this had been ready to go for a while and just needed to be merged... I assumed there were tests in the last commit since it was approved. (Should probably have looked to confirm before writing this comment, but maybe they are already done?)

@codebytere
codebytere force-pushed the robo/fix_worker_custom_protocol branch from a8cbcfe to 644c751 Compare July 27, 2020 21:36
@codebytere
codebytere force-pushed the robo/fix_worker_custom_protocol branch from d7b03dc to 14f35c0 Compare July 27, 2020 21:52

@codebytere codebytere left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test and updated patches - this should be good to merge. We can add additional tests as a follow-up but for now let's mitigate the crash.

@codebytere

Copy link
Copy Markdown
Member

macOS failures are: #24748. Will merge when woa finishes.

@trop

trop Bot commented Jul 28, 2020

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Jul 28, 2020

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Oct 23, 2020

Copy link
Copy Markdown
Contributor

@miniak has manually backported this PR to "8-x-y", please check out #26142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using nodeIntegrationInWorker: true with a service worker crashes SharedWorker broken in 7.0 beta

7 participants