According to MDN, you must specify the URL path . The only way to imagine how to do this is to use the data URI , but when you try to do the following in Chrome:
navigator.serviceWorker.register("data:application/javascript,alert('123');");
is responsible
Unprepared (in promise) DOMException: Failed to register ServiceWorker: The origin of the provided scriptURL ('null') does not match the current origin ("my source URL").
So, I would rather not do this.
Regarding Blob check, which says the same thing you said
Blob is available in the desktop area.
He does not name the type of workers. If you check out the official w3c project , they don't have a word about blob.
The only way to find out is to try it on Chrome yourself. But even if this works for you in Chrome, it does not mean that it will work later. This is still experimental technology.
source share