Service worker is only working on editor preview

I have set up a worker on my account, it sends log data on another endpoint.
the worker is working in editor, but when I deploy, it’s not sending data on the endpoint.
*I have added routes

  2. domain/*

Have you defined https:// or http:// on the route?* not the same as

Add too.