Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8790581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:41:42+00:00 2026-06-13T22:41:42+00:00

I am developing a Google Chrome Extension which has a content-script, a background page,

  • 0

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, 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:41:43+00:00Added an answer on June 13, 2026 at 10:41 pm

    How about adding a listener for chrome.webNavigation.onCompleted in the background script? When a new page is loaded, send a special “ping” message to the tab, and use chrome.extension.onMessage to receive and respond to the ping in your content script. If the content script doesn’t respond then you know that it isn’t running on that page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a simple page action extension in google chrome and it has
I am developing an extension for Google Chrome. My background script, everytime, authorizes on
At the moment I am developing a Google Chrome Extension in which I have
we are in process of developing google chrome extension, in which we need to
I'm developing a Google Chrome extension, which produces an error I can't fix. My
I am developing a Google Chrome extension. When a popup is clicked, I would
I am developing a google chrome extension which retrieves JSON from server after passing
I'm developing a Google Chrome extension with a popup (it's a browser action), and
I'm developing an extension for Google Chrome that generates an mp3 file and saves
I'm developing a google gadget which needs to display one way if it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.