Skip to content
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

Module workers are fetched with incorrect referrer. #1111

Closed
mkruisselbrink opened this issue Apr 22, 2016 · 0 comments · Fixed by #1149
Closed

Module workers are fetched with incorrect referrer. #1111

mkruisselbrink opened this issue Apr 22, 2016 · 0 comments · Fixed by #1149
Assignees

Comments

@mkruisselbrink
Copy link
Contributor

The way the spec is currently written, a "classic" worker is fetched using whatever document/worker created the worker as referrer for the request of the worker script. I would expect the same referrer to be used for the request of the "main" module of a module type worker, but the way the run a worker algorithm is currently written a module type worker completely ignores the referrer parameter that is passed to the algorithm.

@domenic domenic self-assigned this Apr 23, 2016
domenic added a commit that referenced this issue Apr 25, 2016
Fixes #1111, although the problem was more widespread than indicated
there. Previously, *only* classic workers had their referrer set
correctly. This updates the algorithms to:

- Pass the document's address as the referrer for <script>-initiated
  fetches (both classic and module)
- Pass the document's address as the referrer for worker-creation
  fetches (both classic and module)
- Pass the importing module's address as the referrer for
  import-initiated module script fetches
domenic added a commit that referenced this issue Apr 25, 2016
Fixes #1111, although the problem was more widespread than indicated
there. Previously, *only* classic workers had their referrer set
correctly. This updates the algorithms to:

- Pass the document's address as the referrer for <script>-initiated
  fetches (both classic and module)
- Pass the document's address as the referrer for worker-creation
  fetches (both classic and module)
- Pass the importing module's address as the referrer for
  import-initiated module script fetches
domenic added a commit that referenced this issue Apr 29, 2016
As discussed in #1122, #1111, and in
w3c/ServiceWorker#889 (comment),
a number of problems are caused by the current setup of using the
settings object of the worker itself as the feth client. Instead, we use
the incumbent settings object to do the fetching. (Incumbent, instead
of e.g. current, because almost everything else in the (Shared)Worker
constructors uses the incumbent settings object.)

This fixes #1111 since now module workers are fetched with the correct
client, and thus automatically get the correct referrer.
domenic added a commit that referenced this issue May 2, 2016
As discussed in #1122, #1111, and in
w3c/ServiceWorker#889 (comment),
a number of problems are caused by the current setup of using the
settings object of the worker itself as the feth client. Instead, we use
the incumbent settings object to do the fetching. (Incumbent, instead
of e.g. current, because almost everything else in the (Shared)Worker
constructors uses the incumbent settings object.)

This fixes #1111 since now module workers are fetched with the correct
client, and thus automatically get the correct referrer.
domenic added a commit that referenced this issue May 3, 2016
As discussed in #1122, #1111, and in
w3c/ServiceWorker#889 (comment),
a number of problems are caused by the current setup of using the
settings object of the worker itself as the feth client. Instead, we use
the incumbent settings object to do the fetching. (Incumbent, instead
of e.g. current, because almost everything else in the (Shared)Worker
constructors uses the incumbent settings object.)

This fixes #1111 since now module workers are fetched with the correct
client, and thus automatically get the correct referrer.
domenic added a commit that referenced this issue May 10, 2016
As discussed in #1122, #1111, and in
w3c/ServiceWorker#889 (comment),
a number of problems are caused by the current setup of using the
settings object of the worker itself as the feth client. Instead, we use
the incumbent settings object to do the fetching. (Incumbent, instead
of e.g. current, because almost everything else in the (Shared)Worker
constructors uses the incumbent settings object.)

Notably, for fetching module script trees, this necessitates separating
the fetch client settings object from the one used for the module map.

This fixes #1111 since now module workers are fetched with the correct
client, and thus automatically get the correct referrer.
annevk pushed a commit that referenced this issue May 11, 2016
As discussed in #1122, #1111, and in
w3c/ServiceWorker#889 (comment),
a number of problems are caused by the current setup of using the
settings object of the worker itself as the fetch client. Instead, we use
the incumbent settings object to do the fetching. (Incumbent, instead
of e.g. current, because almost everything else in the (Shared)Worker
constructors uses the incumbent settings object.)

Notably, for fetching module script trees, this necessitates separating
the fetch client settings object from the one used for the module map.

This fixes #1111 since now module workers are fetched with the correct
client, and thus automatically get the correct referrer. Dependencies,
however, require further work which will happen as part of #1150.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants