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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:57:38+00:00 2026-05-16T22:57:38+00:00

Using Internet Explorer (don’t appear to have an issue in FireFox) the following code

  • 0

Using Internet Explorer (don’t appear to have an issue in FireFox) the following code will occassionally raise an

Error: Access is denied. 
Code: 0

The line in question is the second window.open.

currentDialog = window.open("error.html", name, "width=20 height=20 left=50 top=70", true);
if (currentDialog != null)
  currentDialog.close();

currentDialog = window.open("about:blank", name, "width=20 height=20 left=50 top=70", true);

However if a delay is introduced – not sure how long is really necessary or about consistency – then the first window opens and closes and the second window will open successfully.

currentDialog = window.open("error.html", name, "width=20 height=20 left=50 top=70", true);
if (currentDialog != null)
  currentDialog.close();

//Small delay to allow slow addons enough time to process OnLoad/OnQuit() 
var date = new Date(); 
var curDate = null; 

do { curDate = new Date(); } 
while(curDate-date < 300); 

currentDialog = window.open("about:blank", name, "width=20 height=20 left=50 top=70", true);

Not happy having some random length of time.

Is there some other way to ensure that currentDialog.close(); doesn’t return until it is properly disposed of such that a new window with the same name can be created successfully within the same function as demonstrated above?

Background

The window is used for displaying a special selection dialog which should be modal. To get modal when the window is created onfocus and onunload events are added so that if the focus changes to the main page the focus is set back to the selection dialog and if the main page is closed then the modal dialog is closed.

When progressing through the selectors quickly sometimes the unhooking of the 1st dialog happens after the attempted hooking of the 2nd dialog and so the dialog doesn’t have an appropriate modal action.

Perhaps a better thing to solve:
Is there perhaps some alternate way to get this modal dialog action and avoid the need for ‘creating’ the intermediate error page?

  • 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-16T22:57:39+00:00Added an answer on May 16, 2026 at 10:57 pm

    Found a nice simple answer

    while(!currentDialog.closed);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this code works fine in Firefox, in chrome/internet explorer i get an error in
I have a [ComRegisterFunction] that I am using to register a BHO Internet explorer
I have the following problem just in the Internet Explorer. The problem is: I
I'm using the following code to override a JavaScript function named dismissRelatedLookupPopup(). In Firefox,
I have some Selenium 2 Webdriver test cases for Firefox and Internet Explorer 9.
I'm creating an Internet Explorer plugin using C#. I've been following a tutorial where
Possible Duplicate: Redirecting to a new page when a user is using Internet Explorer
I am using AutoIT within Internet Explorer to navigate from one web page to
On my Windows machine -- I typically test different versions of Internet Explorer using
I'd like to exclude Internet Explorer from using a specific CSS class. Is this

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.