Service workers need to load "Odoo Bootstrap" to be able to use
"require". The problem is that "Odoo Bootstrap" does operations
on the DOM (by using jQuery) and to avoid errors a minimal
compatibility layer "jquery-sw-compat.js" has been created to
allow using "require" in the service worker.
Moved Service Worker (js) code from the xml to python.