0

Having installed the Mirasvit Push Notification. when I am editing a block in the admin backend, I get the following error in developer tools and I cannot save/update any changes.

In Chrome:

Uncaught DOMException: Failed to read the 'serviceWorker' property from 'Navigator': Service worker is disabled because the context is sandboxed and lacks the 'allow-same-origin' flag.
    at U (https://domain.com/static/version1654251240/adminhtml/Magento/backend/en_US/Mirasvit_PushNotification/js/lib/firebase.js:105:22300)
    at new V (https://domain.com/static/version1654251240/adminhtml/Magento/backend/en_US/Mirasvit_PushNotification/js/lib/firebase.js:105:19725)
    at firebase.INTERNAL.registerService.Messaging [as messaging] (https://domain.com/static/version1654251240/adminhtml/Magento/backend/en_US/Mirasvit_PushNotification/js/lib/firebase.js:105:22828)
    at X.S (https://domain.com/static/version1654251240/adminhtml/Magento/backend/en_US/Mirasvit_PushNotification/js/lib/firebase.js:24:7959)
    at Object.c [as messaging] (https://domain.com/static/version1654251240/adminhtml/Magento/backend/en_US/Mirasvit_PushNotification/js/lib/firebase.js:24:9342)
    at Object.initialize (https://domain.com/static/version1654251240/adminhtml/Magento/backend/en_US/Mirasvit_PushNotification/js/subscriber.js:3:25)
    at https://domain.com/admin_meq3as/pagebuilder/stage/render/key/49d2f5c93f9a1aa614e03b15665de84fa0daa3909a11ef063a20f1ba67a51870/?stageId=G6BKUMV:36:20
    at Object.execCb (https://domain.com/static/version1654251240/adminhtml/Magento/backend/en_US/requirejs/require.js:114:132)
    at Module.check (https://domain.com/static/version1654251240/adminhtml/Magento/backend/en_US/requirejs/require.js:56:457)
    at Module.<anonymous> (https://domain.com/static/version1654251240/adminhtml/Magento/backend/en_US/requirejs/require.js:73:103)

In Firefox:

https://domain.com/push_notification/action/subscribe
CORS Missing Allow Origin
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://domain.com/push_notification/action/subscribe. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 401.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://domain.com/push_notification/action/subscribe. (Reason: CORS request did not succeed). Status code: (null).

1 Answer 1

0

Looks like the issue related to browser or server configuration Please try to check Can't find serviceWorker in navigator anymore

7
  • I have tried with IE Edge, Firefox and Chrome and all of them give error. I have update the question with Firefox Dev Tools Error too. Sites, both Dev Environment and Pre production are served through https. If it's a server configuration where should I look? Nginx, Varnish... Commented Jun 3, 2022 at 15:27
  • Unfortunately, it's paid extension and i cannot check source code. Try to check headers of https://domain.com/push_notification/action/subscribe first Commented Jun 3, 2022 at 15:31
  • I found that running Chrome disabling same origin policy removes the error but that's a workaround. "chrome.exe --user-data-dir="C://Chrome dev session" --disable-web-security". Looking at the response headers I get: access-control-allow-origin *, cache-control no-store, no-cache, must-revalidate, max-age=0, cache-control no-store, no-cache, must-revalidate, max-age=0, x-frame-options: SAMEORIGIN, x-xss-protection: 1; mode=block Commented Jun 3, 2022 at 15:50
  • Try to use curl for curl https://domain.com/push_notification/action/subscribe -X OPTIONS -H "Access-Control-Request-Method: POST" -H "Access-Control-Request-Headers: content-type" -H "Origin: https://domain.com" -I Commented Jun 3, 2022 at 16:28
  • HTTP/2 204 content-type: text/plain charset=UTF-8 pragma: no-cache expires: -1 cache-control: no-store, no-cache, must-revalidate, max-age=0 x-cache: MISS access-control-allow-origin: * access-control-allow-credentials: true access-control-max-age: 1728000 access-control-allow-methods: GET, POST, PUT, DELETE, PATCH, OPTIONS access-control-allow-headers: Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since strict-transport-security: max-age=7889238 cf-cache-status: DYNAMIC Commented Jun 3, 2022 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.