firefox version: 58.0
Type navigator.serviceWorker
in firefox console, and click ServiceWorkerContainer
to expand it.
And get an error: TypeError: 'get ready' called on an object that does not implement interface ServiceWorkerContainer.
What does it mean? And is it a firefox bug?
Probably not a bug, but it's interesting.
When the devtools tried to expand it, in addition to accessing navigator.serviceWorker
's own properties, it tried to access the properties of its prototype (shown in the devtools with the browser-specific __proto__
property name). Apparently when doing that, the this
it gave wasn't navigator.serviceWorker
(my guess is it was the prototype object itself, e.g. Object.getPrototypeOf(navigator.serviceWorker)
), and the implementation of the ready
getter on the prototype expects to be called on an inheriting object (loosely, an "instance"), not the prototype itself.
You'd get the same error if you did this in the Firefox console:
Object.getPrototypeOf(navigator.serviceWorker).ready
Nothing to worry about. :-)