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

  • SEARCH
  • Home
  • 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 8849175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:34:59+00:00 2026-06-14T12:34:59+00:00

Steps to reproduce problem a) Prepare an extension with all the code below b)

  • 0

Steps to reproduce problem

a) Prepare an extension with all the code below

b) Go to https://stackoverflow.com/

c) Click on “Top Questions: headingenter image description here

You will get an error saying “Port error: Could not establish connection. Receiving end does not exist”

Manifest file

  {
  "name": "Demo",
  "version": "1.0",
  "manifest_version": 2,
  "description": "This is a demo",

  "content_scripts": [ {
        "all_frames": true,
        "js": ["contentscript1.js" ],
        "matches": [ "https://stackoverflow.com/" ]
        }]
  }

Editor.html file

<html>
<head>
<script src="editor.js"></script>
</head>
<body>
<div id="content"></div> 
</body>
</html>

Editor.js file

function onRequest(message,sender,call){ 
     document.getElementById("content").value = message; 
}
 chrome.extension.onMessage.addListener(onRequest);

contentscript1.js

function bindevent(){ 
window.open(chrome.extension.getURL("editor.html"),"_blank","toolbar=no, titlebar=no,location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=720, height=400");
    message = "Sample Message"; 
    chrome.extension.sendMessage(message,function (res){}); 

}; 

document.getElementById('h-top-questions').onclick=bindevent;

Any suggestions??

  • 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-14T12:35:00+00:00Added an answer on June 14, 2026 at 12:35 pm

    I am sending message while child window/extension page is still loading; I have sent message after it loaded completely and it solved my problem.

    Final Code

    Manifest file

    {
      "name": "Demo",
      "version": "1.0",
      "manifest_version": 2,
      "description": "This is a demo",
    
      "content_scripts": [ {
            "all_frames": true,
            "js": ["contentscript1.js" ],
            "matches": [ "http://stackoverflow.com/" ]
            }]
      }
    

    Editor.html file

    <html>
    <head>
    <script src="editor.js"></script>
    </head>
    <body>
    <div id="content"></div> 
    </body>
    </html>
    

    Editor.js File

    var message = window.location.hash.substring(1);
    

    contentscript1.js

       function bindevent(){
     message = "Sample Message"; 
        window.open(chrome.extension.getURL("editor.html")+"#"+message,"_blank","toolbar=no, titlebar=no,location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=720, height=400");
        }; 
    
    document.getElementById('h-top-questions').onclick=bindevent
    

    ;

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

Sidebar

Related Questions

I found a strange ToolStripButton double click problem. These steps will reproduce the problem:
EDIT: Firefox 2 windows XP Steps to reproduce problem: Firefox 2 and visit: http://resopollution.com/rentfox/html/property_setup.html
What steps will reproduce the problem? Create a MenuBar object (createMenuBar) Create a Server
Android 2.1 - Eclipse What steps will reproduce the problem? 1. Create new Texture(managed)
I'm learning javascript and can't figure out the problem in my code below. I
I am improving one site now - http://vse-v-nas.com.ua (link just for reproduce steps, if
Here are the steps to reproduce the problem I need help with. download the
The below code makes application freeze when changing focus from Edit1 to Edit2 after
We are using Mobiscroll ( http://code.google.com/p/mobiscroll/ ) as Date Picker solution in our smartphone
I've created solution to reproduce a problem that I'm having with MVVM-Light EventToCommand vs

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.