Closed joeuan closed 1 year ago
Version: 6.0.0-rc2
in content-script: allowWindowMessaging('test') sendMessage('hello', 'world', 'test')
in injected script(append a script element): import { setNamespace,onMessage } from 'webext-bridge/window' setNamespace('test') onMessage('hello', console.log )
get error when sendMessage: Bridge#sendMessage -> Destination must be any one of known destinations
You need to use sendMessage('hello', 'world', 'window'). Namespace 'test' is just an internal setting that webext-bridge relies on.
sendMessage('hello', 'world', 'window')
'test'
webext-bridge
Version: 6.0.0-rc2
in content-script: allowWindowMessaging('test') sendMessage('hello', 'world', 'test')
in injected script(append a script element): import { setNamespace,onMessage } from 'webext-bridge/window' setNamespace('test') onMessage('hello', console.log )
get error when sendMessage: Bridge#sendMessage -> Destination must be any one of known destinations