w3c / w3c/ServiceWorker

FetchEvent: add origin check before setting replacesClientId

Open
#1,679 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Bikeshed
Stars
3.6k
Forks
324
Avg merge
14d 22h
Merged PRs (30d)
1

Description

As part of implementing replacesClientId, the issue of what to do in the event of a cross-origin navigation came up. In such a case, replacesClientId will be the id of a client whose origin is different from the service worker handling the fetch event.

So, it feels as if Step 24.3.9 of Handle Fetch should include a same origin check and initialize replacesClientId to the empty string if it fails?

I can also write additional tests for this specific situation as part of https://github.com/WebKit/WebKit/pull/13130

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Step 24.3.9 of Handle Fetch in the linked Service Worker specification and review the behavior of replacesClientId during cross-origin navigation. Add coverage for this specific situation, as suggested in the issue and related WebKit pull request, and verify that the specification and tests agree on the expected result.

Written by the indexing model from the issue text.

Assessment

Domain
web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.