Closed Bug 527713 Opened 15 years ago Closed 14 years ago

toggleFIPS in device_manager.js should not use window.alert

Categories

(Core Graveyard :: Security: UI, defect)

1.9.2 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla2.0b2

People

(Reporter: marcoos, Assigned: marcoos)

References

()

Details

(Whiteboard: [good first bug])

Attachments

(2 files, 1 obsolete file)

toggleFIPS() uses the generic JS window.alert method to display an alert window.
This is bad, as this alert window looks like an alert from a webside, with "[JavaScript Application]" in its title, while it's an application-level alert.

Probably nsIPromptService's alert method would be a better choice here. :)

(This bug was originally filed in the Polish localization team's Bugzilla - http://bugs.aviary.pl/show_bug.cgi?id=2753 )
To reproduce:

1. In Firefox, go to Preferences -> Advanced -> Encryption -> Security Devices -> Enable FIPS
Version: unspecified → 1.9.2 Branch
Assignee: kaie → nobody
Whiteboard: [good first bug]
Attached patch Patch (obsolete) — Splinter Review
There's already a doPrompt function which does wrap around nsIPromptService's alert method and is used throughout this script.

This patch replaces the two occurences of JS alert() function calls with doPrompt() wrapper calls.

(Though probably its name should really be doAlert instead of doPrompt)
Attachment #411587 - Flags: review?(kaie)
Attachment #411587 - Attachment is patch: true
Attachment #411587 - Attachment mime type: application/octet-stream → text/plain
Comment on attachment 411587 [details] [diff] [review]
Patch

r=kaie

thanks for this patch, I've tested it.

I see there are additional occurrences in security/manager/pki where a simple alert is being used, which give the same effect.
Attachment #411587 - Flags: review?(kaie) → review+
This replaces all alerts with promptService.alert (even the commented-out ones). 
(Basically, copied the doPrompt function from device_manager.js to other scripts and replaced all alerts with it).
Attachment #412032 - Flags: review?
Attachment #412032 - Attachment is patch: true
Attachment #412032 - Attachment mime type: application/octet-stream → text/plain
Attachment #412032 - Flags: review? → review?(kaie)
Did this patch get checked in?
Comment on attachment 412032 [details] [diff] [review]
Replace other alerts, too :)

r=kaie

I wish we could move the doPrompt function to a single place, and include from everywhere.

But given the function is really small and trivial, I won't bother, unless you're up to doing it.
Attachment #412032 - Flags: review?(kaie) → review+
Assignee: nobody → marcoos+bmo
Keywords: checkin-needed
Attachment #411587 - Attachment is obsolete: true
http://hg.mozilla.org/mozilla-central/rev/226f250e9e9c
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b2
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: