How can I offer client side only assets via a service worker?

Been looking into Service Workers and something that stuck out was the install life cycle. Since a service work is not available till after the web page is fist visited and the refreshed it means it would not be possible to use a service worker to serve client side only assets. Is this true?

I’m looking for a solution where A Web Application was able to collect user input as file contents and then have a service worker serve those assets to an IFrame. The use case being a browser based code editor like JSFiddle or Code Pen where multiple files could be created (JS, CSS, etc.) and the IFrame’s requests are intercepted and provided for by the what was entered. That way things like ES6 modules could be split across multiple files all without having to save them to a back end server.

Is this even possible? And if so what is a good way to help the user through that first time refresh cycle as in the first visit such assets would be missing as the service worker hasn’t been activated yet?