Closed daviddias closed 8 months ago
I believe this is a service worker feature, not a bug.
See https://developers.google.com/web/fundamentals/instant-and-offline/service-worker/lifecycle#the_first_service_worker (particularly the Activate and clients.claim sections)
The default is consistency, if your page loads without a service worker, neither will its subresources. If you load the demo a second time (in other words, refresh the page), it'll be controlled
Oh hello @diasdavid sorry for the late response but yes we use clients.claim
in a event listener on the activate event https://github.com/MetaMask/metamask-extension/blob/master/mascara/src/background.js#L35
how ever we also reload the "ui" if we find we haven't made a connection with the sw but the sw is active https://github.com/MetaMask/metamask-extension/blob/master/mascara/src/ui.js#L49L55 (this might be unnecessary for what your doing)
@frankiebee can you show me the piece in Mascara that solves this issue?