You're getting a CROS error because you're calling the request from the content script. If you execute the request from the service worker page or from the iframe, then CORS error will not occur. Accordingly, in order to create communication between the content script and the service worket page, you need to use chrome.runtime.sendMessage
Here is an article on this topic: https://developer.chrome.com/docs/extensions/reference/api/runtime?hl=ru#method-sendMessage