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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:19:45+00:00 2026-06-07T09:19:45+00:00

I have a dialog in my addon which is opened when some deletion process

  • 0

I have a dialog in my addon which is opened when some deletion process is completed. I use for all such messages XUL dialog that looks like this:

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://myaddon/skin/Style.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://myaddon/locale/mydtd.dtd">

<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        class="dialog" ondialogcancel="return true;">
    <dialogheader id="dlgHdr"/>
    <vbox flex="1" id="content" pack="center">
    </vbox>
    <script
        type="application/x-javascript"
        src="chrome://myaddon/content/mainScript.js"
    />
    <script
        type="application/x-javascript"
        src="chrome://myaddon/content/dialogInit.js"
    />
    <tfs_string id="new-profile-success" value="&newProfileSuccess.Text;"
                style="overflow: hidden" />
    <tfs_string id="delete-profile-success" value="&deleteProfileSuccess.Text;"
                style="overflow: hidden" />
</dialog>

It has cancel button, ondialogcancel handler returns true. But it doesn’t close immediately after pressing button. I have to drag this dialog a little to make it disappear. Moreover, this problem only happens when I restart browser after reinstalling addon. After one more restart dialog is closed immediately after i press Cancel. I use this dialog for some other messages, and they don’t have such a problem.

If I close window and open it again with Chromebug debugger instead of restarting using popup, I can’t reproduce this bug. But if I lauch another FF version and then first version again (with debugger), I manage to reproduce it. But when I use step-by-step execution on dialogcancel handler, Chromebug’s interface becomes unresponsive (except script content area) and dialog doesn’t close after I see in debugger that window.close() is executed, so I have to drag dialog window around a little again to make it disappear.
What should I do?

  • 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-07T09:19:46+00:00Added an answer on June 7, 2026 at 9:19 am

    I finally found the reason. Problem was indeed caused by dialogInit.js script.

    window.addEventListener('load', function () { myext.simpleDialogInitialize(); }, false);
    window.addEventListener("MozAfterPaint", function () { window.sizeToContent(); }, false);
    window.addEventListener('unload', function () { myext.simpleDialogFinalize(); }, false);
    

    It contains even handlers for ‘load’ and ‘unload’ events. First one calls initializer specified in a method that opens this window. But there was one more handler for ‘MozAfterPaint’ event that called window.sizeToContent, so that infinite loop was triggered, I guess. Extension wasn’t created from scratch so I didn’t notice this mistake for some time. I moved resizing to the ‘load’ event handler after calling that initializer, works fine.

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

Sidebar

Related Questions

I have a dialog box that allows users to set hotkeys for use in
I have a dialog that resizes. It also has a custom background which I
I have dialog created like this $('#add_error').click(function(e) { $('<div>') .load('/someaction/format/html/') .dialog({ title: 'Some title',
I have a dialog preference with a button on it that I want to
I have a dialog that I want to place within another dialog and position
I have a dialog box with controls that is popped up and when a
i have a dialog box that opens on pageload for a site. script type=text/javascript>
I have 2 dialog boxes in which I will display 1 dialogbox at a
I have a dialog in Java that presents ~ 15 checkboxes to the user.
I have a dialog that I want wrapped in a div like so. <div

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.