1

Hello I'm trying to send data from content-script to webpage.

In content script I have a listener:

chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
  sendResponse("Hello, I'm from content.js")
});

From chrome console I tried sending a message and got the following error: enter image description here

I googled a lot on this and most of them talk about messaging between content and background. None of them discuss messaging between content and webpage. Any help?

Community
  • 1
  • 1
across
  • 157
  • 7
  • 2
    Use [standard DOM messaging via CustomEvent](https://stackoverflow.com/a/19312198). – wOxxOm May 21 '20 at 07:35
  • @wOxxOm I'm going through that link. Btw google pointed to many of your answers and they're extremely helpful. Thank you so much for your awesomeness:) – across May 21 '20 at 07:38
  • @wOxxOm DOM messaging worked XD Thanks again:)) – across May 21 '20 at 07:49

0 Answers0