Skip to content

Instantly share code, notes, and snippets.

@zenchild
Created February 2, 2010 15:14
Show Gist options
  • Save zenchild/292732 to your computer and use it in GitHub Desktop.
Save zenchild/292732 to your computer and use it in GitHub Desktop.
// This is a convenience method that exists to determine if the window should be closed or not.
// There could be a lot more logic here, but for now we are just closing any window whose
// location property is equal to "chrome://global/content/commonDialog.xul", which is what the
// alert boxes that I have tested use.
alertClose: function (subject) {
if(subject.location == "chrome://global/content/commonDialog.xul") {
window.setTimeout(function() { subject.close(); }, 1000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment