Closed Bug 613806 Opened 10 years ago Closed 10 years ago
alert(), confirm(), prompt() dont play system alert sounds
To play a sound could be confusing. Assume you have three tabs A B C opened and you currently have tab A visible. Now C creates an alert. Previously alerts were modal and the tab that created one was brought to the front so you heard the sound, saw the alert and the tab that created it (here: tab C). Now that alerts aren't modal anymore you would get the sound, but tab A remains visible and you wonder why the sound was played.
There's some discussion on bug #598824 about what happens to show the user when an inactive tab brings up a dialog. If it was decided to have a glow effect for other tabs and to make the browser autoscroll to that tab if it's offscreen, then it would be more obvious to the user.
(In reply to comment #1) > Do we want this? Yes in corporate world it is needed. Many intranet application there comes specification asking when to play what sound and what message. In our company we have a standard flash library to achieve that. I assume other companies will be depending on this feature, and firefox should continue providing that depending upon user OS setting. As was there before bug 59314 fix. When at work personally I dont like sounds coming from the System, especially from a web application. I do wish there is about:config item to disable it.
Oops, I actually accidentally broke this in bug 575485. Simple fix. But it does raise the question of if tab-modal prompts should play an sound or not -- I don't think they should. They're supposed to be part of the web page, and are explicitly not supposed to look or behave as an official system dialog. We've already made this call on other aspects of the dialogs, so I'm only un-breaking the sounds for normal prompts.
Assignee: nobody → dolske
Attachment #492236 - Flags: review?(gavin.sharp)
Summary: alert(), confirm(), prompt() dont ring bell → alert(), confirm(), prompt() dont play system alert sounds
Comment on attachment 492236 [details] [diff] [review] Patch v.1 It looks to me like nsISound implementations exist on all the platforms we care about (and even qt, os/2 and beos!), and the playEventSound implementations don't throw in any of them (except for in edge cases like OOM), so I don't think the try/catch is useful except for hiding issues like these... but I suppose it's better safe than sorry at this point, so maybe just add a reportError() to the catch? A comment mentioning the |if (xulDialog)| check's purpose (limit this to non-tabmodal prompts) would be useful too.
Attachment #492236 - Flags: review?(gavin.sharp) → review+
Attachment #492236 - Flags: approval2.0+
Yeah, I'll just add a reportError for now. This is just cut'n'paste from the original patch that added this code to commonDialog.js (bug 463209). Perhaps Masayuki remember why it was done that way?
because the method might return NS_ERROR_NOT_IMPLEMENTED or something in future especially when some developers will implement new platform's widget. If the playEventSound() stops the initialization of the dialog, it make users confuse.
> To play a sound could be confusing. > Assume you have three tabs A B C opened and you currently have tab A visible. > Now C creates an alert. > Previously alerts were modal and the tab that created one was brought to the > front so you heard the sound, saw the alert and the tab that created it (here: > tab C). > Now that alerts aren't modal anymore you would get the sound, but tab A remains > visible and you wonder why the sound was played. This shouldn't be a problem. Windows does exactly the same. If some application does something I ought to know then a sound is issued and in the taskbar the program's icon starts blinking and turning orange. As the notification for dialogs in non-focused tabs will probably be very similar this is common and thus expected behavior.
Status: NEW → RESOLVED
blocking2.0: ? → -
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
You need to log in before you can comment on or make changes to this bug.