I am developing a Google Chrome Extension which has a content-script, a background page, a settings page and a popup page. I learnt the hard way that though the content-script loads on the Chrome Web Store, the onMessage listeners are never invoked.

I can consistently break at the point where I am executing `chrome.extension.onMessage.addListener`, but the listener is never invoked. Therefore when I execute `chrome.tabs.sendMessage` from the background or popup pages, the `responseCallback` function never gets invoked - i.e. the logic inside the `responseCallback` never executes. Chrome doesn't even treat this like an error scenario - it accepts the request, but goes silent thereafter.

If it had treated this as an error case (as with attempting to message a `chrome://` page) then the `responseCallback` would've been invoked with a undefined response argument - and that would cause my error-handling code to execute... but no such luck.

I could add special behavior in my code for `http(s)://chrome.google.com/webstore/*`, but was hoping that there was a more official way of finding pages that were barred from execution. Would appreciate any pointers there.

I found a great post [here](https://stackoverflow.com/questions/11613371/chrome-extension-content-script-on-https-chrome-google-com-webstore), but it doesn't have a programmatic API, hence this question.

I am already aware that the Chrome webstore and `chrome://` URLs are special cases. However, per my investigation, the behavior on `chrome://` URLs is different than on the Chrome Web Store. On `chrome://` URLs, my content-script appears to not load at all and the `sendMessage`'s `responseCallback` function gets invoked with a null/undefined response object. That is the API's official way of signalling an error and it works fine for me.

My issue is with being able to programmatically detect the errors like those experienced with the Chrome Web Store without having to hardcode the URLs (the URLs could change with time).

Thanks in advance for your responses.