It's intentionally limited, otherwise everyone will just use this document instead of the service worker and everyone will understand (not just 1% of savvy developers) that Chromium team has made a big mistake switching to a service worker, the least suitable JS environment for an extension background script due to the multiple artificial limits that make sense only for serving remote web pages.
The solution is to use `chrome` API in the service worker i.e. the offscreen document would send a message:
- chrome.runtime.sendMessage
- BroadcastChannel
- direct via (await navigator.serviceWorker.ready).active.postMessage(123) in the caller and self.onmessage = async e => { ........; e.source.postMessage(456) } in the SW.
Web messaging (BroadcastChannel, navigator.serviceWorker) supports more types of data, including binary like Blob, Uint8Array, ArrayBuffer, Map, Set, etc.