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 8997463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:53:34+00:00 2026-06-15T23:53:34+00:00

I’m trying to get the popup/popopen menu to show the user different content based

  • 0

I’m trying to get the popup/popopen menu to show the user different content based off the current page-URL but can’t get a connection. I’ve read that only background.html has access to current-tabs’ URLs in the Chrome framework, so I’m trying to get it to tell my content-script and my popup.js this via message-passing — background.html will receive a message and will include the right info in the response. Popup should be able to use getBackgroundPage() but content-injection scripts are not allowed to so I’d like to use messaging for both and have a common solution.

So… the console-messages about failed connections are buried in some random implementation code which I can’t even view, namely: miscellaneous_bindings:236 or miscellaneous_bindings:235, depending on the arguments to the cal. Trying to view where we hit gets me this:

The webpage at chrome-devtools://devtools/miscellaneous_bindings might be temporarily down or it may have moved permanently to a new web address.

I’m convinced I’m doing something silly or else my system’s messed up but I can’t figure out which. Most of the examples and questions I’ve seen either require beta-release channel functionality or use v1.0 manifests, use deprecated functions (questions from like 2011), or don’t have accepted answers. I’m with Chrome 24.0.1312.40 m
and I’ve disabled other extensions.

Here’s how we’re set up…

popup.html

<!doctype html>
<html>
    <head>
        <title>Working title popup</title>
        <script src="popup.js">
            // nothing allowed in here
        </script>
    </head>
    <body>

    <form>
        <fieldset>
        <button>Demo</button>
        <!--^ push to try again to get response string from background -->
        </fieldset>
    </form>

    </body>
</html>

popup.js:

asky();

function asky(){
        catchersMit=null;
        console.log("Going to get info.");
        // Below causing Port error: 
        //"Could not establish connection. Receiving end does not exist.":
        chrome.extension.sendMessage({msg:"need some info"} //arg1
                                     ,function(response){   //arg2
                                        alert(reponse.msg);
                                        //^ yields undefined in alert window
                                        catchersMit=response;}
                                    );
        //_*_ catchersMit still appears undefined out here.
}

background.html:

<!doctype html>
<html><head><script type="text/javascript">
chrome.extension.onMessage.addListener(

function(message,sender,sendResponse){
                sendResponse( {msg: "info you wanted"} );
} // anonymous (1st parameter) function OUT

); // onRequest listener OUT
</script></head><body></body></html>

manifest.json:

{
  "name": "Extension Working Title",
  "version": "1.0",
  "manifest_version": 2,
  "description": "Coolest functionality.",
        "browser_action": {
    "default_icon": "lnr_icon.png",
        "default_popup": "popup.html"
  },

  "permissions": [ "tabs","http://*/*" ],
  "background": { "page": "background.html" }
}

Right now I’m just working with popup.js as I find it easier to debug, but the resolution to this issue should not be different between that and the content-script if I’m not mistaken.

  • 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-15T23:53:35+00:00Added an answer on June 15, 2026 at 11:53 pm

    Assuming you need current browsing tab URL from your problem statement(I'm trying to get the popup/popopen menu to show the user different content based off the current page-URL), the following code will fetch the current Browsing tab URL, you can play on it for filtering required information.

    chrome.tabs.query({
                "status": "complete",
                "currentWindow": true,
                "active": true
            }, function (tabs) {
                for(tab in tabs)console.log(tabs[tab].url);
    });
    

    There is no need of added message passing between background and browser action HTML page.

    Content Scripts have already access to URL through window.location.href

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

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a small JavaScript validation script that validates inputs based on Regex. I
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to show the soap response to UIWebview.. my soap response is, <p><img

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.