Messaging API compatibility
Hi is
@plasmohq/messaging
works on every web browser or only in chrome? I need to work in safari and firefox.25 Replies
Should work on Safari (tested it before). For Firefox, PR to make it compat is welcome :)
On firefox
sendToBackground
works well in content script but in popup I dont getting return value from backgruond function
messages/login.ts
Popup/index.tsx:
When I click login in popup the request is send but console.log(resp) is undefind@wybran has reached level 1. GG!
is there any bgsw error logging?
tho iirc, bgsw is not yet a thing in ff?...
there are no errors
so why is working in content script but not in popup 🙃
oh it works with CS but not with popup?
yes
the one thing I know about firefox popup is that you can't open its inspect lol...
in popup only send message but not getting return data
try doing it manually and see what's the diff :d....
it could be that ff's popup runtime is behind cs runtime xd
so popup might be using the callback api meanwhile cs is using the promise api lol that'd be messed up
console.log in popup useEffect triggers faster than console.log in background script
![](https://cdn.answeroverflow.com/1111579496190058576/image.png)
hmm, that indicates the API on ff is using callback
I suspect that's the case :d.....
on chrome and safari it is working
yeah since chrome and safari aligns well on that API
but firefox... kinda do their own thing nowaday
do you have any ideas how can I fix it?