Closed Bug 1039869 Opened 11 years ago Closed 11 years ago

Components.interfaces.nsIAlertsService and Components.interfaces.nsIWindowWatcher don't allow two non-modal alerts at the same time

Categories

(Toolkit Graveyard :: Notifications and Alerts, defect)

33 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 324570

People

(Reporter: peter.kehl, Unassigned)

Details

Attachments

(1 file)

1.93 KB, application/vnd.mozilla.xul+xml
Details
Attached file two_popups.xul
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0 (Beta/Release) Build ID: 20140713030204 Steps to reproduce: 1. Have a privileged XUL file, which tries to show two non-modal alerts one after the other (from the same thread, with no added time delay between them), using either Components.interfaces.nsIAlertsService or Components.interfaces.nsIWindowWatcher. That's either on Linux (Fedora 20 x64) or Windows 7 Pro SP1. 2. Components.interfaces.nsIWindowWatcher doesn't show popups on Windows 7 Pro SP1. If you change the end of the attached .xul to run only one call to showAlert( 'first message', '1st alert', 2 ); then you get no popup at all on Windows 7. Actual results: Run the attached .xul file registered as chrome://something... 1. It should show two popups. Neither is shown (on Linux or Windows). 2. If you use way/method 1 (Components.interfaces.nsIWindowWatcher... openWindow()), it doesn't show any popup even if it would be just one popup. Expected results: 1. It should generate two popups (or one, at least). 2. When using the 2nd way/method on Windows 7 Pro SP1, it should show a message. This is both with current Firefox 30 and also with Firefox Nightly 33.0a1 (2014-07-13).
Summary: Components.interfaces.nsIAlertsService and Components.interfaces.nsIWindowWatcher don't allow two non-modal alerts in a row. And Components.interfaces.nsIWindowWatcher doesn't work on Windows. → Components.interfaces.nsIAlertsService and Components.interfaces.nsIWindowWatcher don't allow two non-modal alerts at the same time. And Components.interfaces.nsIWindowWatcher doesn't work on Windows 7.
Component: Untriaged → XUL
Product: Firefox → Core
Please, 1 issue per bug. If I run this in a browser-privileged scratchpad (shift-f4, set environment to browser): function showAlert(msg, title){ var win = Services.ww.openWindow(null, 'chrome://global/content/alerts/alert.xul', '_blank', 'chrome,titlebar=no,popup=yes', null); win.arguments = [null, title, msg, false, '']; } showAlert('second message', '2nd alert'); on Windows 7 or 8, against current Firefox 31/32, it works fine. But really, you should be using the alerts service, not mess around with the window watcher for the default alerts. The other issue is a duplicate: bug 324570
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Component: XUL → Notifications and Alerts
Product: Core → Toolkit
Resolution: --- → DUPLICATE
Summary: Components.interfaces.nsIAlertsService and Components.interfaces.nsIWindowWatcher don't allow two non-modal alerts at the same time. And Components.interfaces.nsIWindowWatcher doesn't work on Windows 7. → Components.interfaces.nsIAlertsService and Components.interfaces.nsIWindowWatcher don't allow two non-modal alerts at the same time
(In reply to :Gijs Kruitbosch (Gone July 26 - August 3) from comment #1) > The other issue is a duplicate: bug 324570 > > *** This bug has been marked as a duplicate of bug 324570 *** Oh, but note bug 324570 comment #12 there, which may be of use.
:Gijs, Thank you for pointing to the existing issue. As per using Services.ww.openWindow: I get the following in Scratchpad of Firefox 30, 31 and 32.0b1: /* Exception: Services is not defined showAlert@Scratchpad/1:11:1 @Scratchpad/1:15:1 */
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
(In reply to Peter Kehl from comment #3) > :Gijs, > > Thank you for pointing to the existing issue. > > As per using Services.ww.openWindow: I get the following in Scratchpad of > Firefox 30, 31 and 32.0b1: > > /* > Exception: Services is not defined > showAlert@Scratchpad/1:11:1 > @Scratchpad/1:15:1 > */ "Services" here is Services.jsm: http://mxr.mozilla.org/mozilla-central/source/toolkit/modules/Services.jsm So Services.ww === your longer version of getting the windowwatcher service. If Services is not defined, you probably neglected to set the scratchpad to running in the browser environment as noted at the top of comment #2, or closed the last browser window meaning it no longer runs in a browser window's scope. You really need to do the former; you could use Services irrespective of the latter (or if you run your code in a module or another non-browser window) by Cu.import'ing it as noted on the MDN page here: https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Services.jsm . This doesn't really change that this bug report is a duplicate, however.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → DUPLICATE
Gijs, Thank you for explaining.
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: