When does code in a service worker outside of an event handler run? : <p>(I am paraphrasing question asked by Rich Harris in the "<a href="https://gist.github.com/Rich-Harris/fd6c3c73e6e707e312d7c5d7d0f3b2f9">Stuff I wish I'd known sooner about service workers</a>" gist.)</p>

<p>If I have code in my service worker that runs outside an event handler, when does it run?</p>

<p>And, closely related to that, what is the difference between putting inside an <code>install</code> handler and putting it outside an event handler entirely?</p>
