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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:40:01+00:00 2026-05-18T06:40:01+00:00

I have an extension that needs to pop up a window and then close

  • 0

I have an extension that needs to pop up a window and then close it.

 var my_extension = {
    window: null,
    popup: function(){
       my_extension.window = window.open(...)
    },
    close: function(){
       my_extension.window.close()
    }
 }

The popup calls the close function. However, after returning from the open, the my_extension.window is null. I check to make sure it is set in popup. Is another instance of my_extension created when the popup returns?

  • 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-05-18T06:40:01+00:00Added an answer on May 18, 2026 at 6:40 am

    my_extension is defined in the main browser window, not in the popup. To close the popup from the popup itself, just use window.close

    edit: ok, so I guess my_extension.close actually looks something like:

    function() {
      // check input from popup window
      if (everythingIsGood) {
        my_extension.window.close()
      }
    }
    

    In that case, I would recommend you do that validation in the popup itself. I know, you don’t want to put a lot of code in the popup window. And I agree. But you can pass in whatever information is necessary to do the validation (including passing a validation function — remember that functions are objects too, because JavaScript is cool like that!) when you open the popup. Look for the discussion of window.arguments on this page: https://developer.mozilla.org/en/DOM/window.openDialog

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

Sidebar

Related Questions

I have an xslt stylesheet that needs to call a C# XSLT extension function
I have a PHP web application that needs to call a function in a
I have an extension method that needs to return an HtmlString. The method has
I have this script that needs to replace a file extension and it is
I have a firefox extension that needs to get the exact screen co-ordinates of
I have a legacy program that I need to run with the extension of
Imagine i have an extension method that operates of an interface of abstract objects:
I have a HtmlHelper extension method that I would like to apply some logic
I have an MFC extension DLL that I've written. It contains derived classes of
I have developed a python C-extension that receives data from python and compute some

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.