serversideup / webext-bridge

💬 Messaging in Web Extensions made easy. Batteries included.
https://serversideup.net/open-source/webext-bridge
MIT License
547 stars 50 forks source link

fix: window messages having assigned invalid `origin` #3

Closed Andarist closed 3 years ago

Andarist commented 3 years ago

As showcased by the asserted types - this was incorrect. More importantly though, this has resulted in a broken behavior because I was not able to send a message to devtools from a window. After my message got broken by this assignment the background script was not able to route this message because it was being discarded by this check: https://github.com/antfu/webext-bridge/blob/9ab5a9d50ea50fb6d509750e0e554755f705735c/src/internal.ts#L95