Closed Bug 1145627 Opened 9 years ago Closed 9 years ago

[ServiceWorkers] matchAll doesnt work the first time is run just after sw installation

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: arcturus, Unassigned)

References

Details

Attachments

(2 files, 1 obsolete file)

Attached file sw.html (obsolete) —
When installing a SW and then asking for matchAll, the first time that sw has been installed, we get an empty array.

Reload the page and ask for a matchAll and you'll get the array of clients that the sw is handling.
Attached file sw.js
Adding sw.html and sw.js to try this out.
Attached file sw.html
Attachment #8580704 - Attachment is obsolete: true
Was doing the same test in canary and also I'm not able to get the clients the first time the SW is registered.

Again, if I refresh the page I can get the message from the worker. Is that the expected behavior?
(In reply to Francisco Jordano [:arcturus] [:francisco] from comment #3)
> Was doing the same test in canary and also I'm not able to get the clients
> the first time the SW is registered.
> 
> Again, if I refresh the page I can get the message from the worker. Is that
> the expected behavior?

Right.  The page is not controlled on the first load.  I believe we need the .claim() API for the SW to control the first page immediately in the oninstall event.
Depends on: 1130684
Closing since this is the intended behavior.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: