New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 880768 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

srcdoc and `about:blank` iframe subresources should be captures by parent SW

Project Member Reported by y...@yoav.ws, Sep 5

Issue description

Chrome Version: M70
OS: N/A

Srcdoc and about:blank nested context documents are currently not covered by their parent’s service worker. That results in some discrepancies (e.g. Resource Timing reports the URLs that these document load, but service worker doesn’t intercept them).

Related spec discussion: https://github.com/whatwg/html/pull/3725

Is seems like Firefox and Safari already do the right thing.

(very) rough implementation design document: https://docs.google.com/document/d/1no9CojJ5lYepbuWiHE6Pk51z6-IePErHpQCx_PMZa4E/edit#
 
Cc: alex...@chromium.org creis@chromium.org
I can understand using the parent for srcdoc, however about:blank is a bit trickier. Is it supposed to be the parent or the document which created the about:blank document by navigating the frame? 
An example of the latter case would be document on a.com having two iframes to b.com and c.com. If b.com navigates the c.com frame to about:blank, the b.com frame is the navigation initiator. In this case the navigation initiator is technically the origin for the new about:blank document, however blink historically has not supported that. We are looking at changing it, so it will be ideal to not hardcode another instance where origin (and in this case SW) is inherited by the parent instead of the navigation initiator.
Can we verify how Firefox and Safari behave in the case where navigation initiator is not the parent frame?
Cc: wanderview@chromium.org
I think the service worker discussion about this has so far focused on the initial about:blank case.  I don't think we have a test for the condition you are asking about.

There is some discussion about a similar situation with blob URL frames, though.  See:

https://github.com/w3c/ServiceWorker/issues/1261

I just tested creating a cross-origin iframe and then navigating it to "about:blank" from the parent in firefox 63.  Currently it does not inherit the controller at all right now.

Anyway, its probably reasonable to proceed with the initial about:blank and srcdoc cases for now until the spec is clarified.  I filed an issue to discuss the navigate-to-blank case:

https://github.com/w3c/ServiceWorker/issues/1350
It is fair to focus on initial empty document initially, I just want to ensure we don't make any assumptions in this work about parent being the only source of origin information. Similarly, window.open() with no URL is a variation of this where the origin is inherited from the opener. So as long as we structure the design to be flexible and accommodate those cases with simple follow up work, it is fine with me.
Components: Blink>ServiceWorker
Status: Available (was: Untriaged)

Sign in to add a comment