Closed kingname closed 8 months ago
P.S.: It works well when I send message from popup.tsx to background.
Only error from content script to background.
Hi there, have you tried doing something like this?
if (url === 'google.com') {
console.log('hit greenhouse.io! return rules...');
rules = {
xxx: true
}
res.send(rules)
}
res.send("err, not google"); // ensure a response is sent back in every case
I think if your content script is in the "isolated" world, which it appears to be in, the problem is caused by no response being sent back from your message handler
@Acorn221 Good point. I will make a try this evening. However, why does popup.tsx work well?
I can't be sure without seeing the code! Maybe your popup handler always returns something?
@Acorn221 You save me. By using your advice, it works like a charm.
What happened?
A bug happened!
background could not receive any message. instead, an error occur:
Version
Latest
What OS are you seeing the problem on?
MacOSX
What browsers are you seeing the problem on?
Microsoft Edge
Relevant log output
(OPTIONAL) Contribution
Code of Conduct