Closed Bug 103188 Opened 24 years ago Closed 24 years ago

Should window.prompter be enumerable?

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.6

People

(Reporter: steve.toth, Assigned: jst)

Details

(Whiteboard: [HAVE FIX])

Attachments

(2 files)

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) BuildID: 2001100403 This bug appeared after the fix to bug 99663. After the fix, I re-ran the original test case and it is still broken, but it looks like for different reasons. when the for loop goes over the window.prompter variable, it fails to wrap the object. It looks like I don't have permission to do this. Reproducible: Always Steps to Reproduce: To use the test html page. 1. click on WRITE WINDOW, this generates JS exceptions. Actual Results: The exceptions generated are... *********************************** Error: [Exception... "'JavaScript component does not have a method named: "getHelperForLanguage"' when calling method: [nsIClassInfo::getHelperForLanguage]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "JS frame :: http://bugzilla.mozilla.org/attachment.cgi?id=49359&action=view :: rewriteCallback :: line 38" data: no] Source File: http://bugzilla.mozilla.org/attachment.cgi?id=49359&action=view Line: 38 *********************************8 Error: [Exception... "'JavaScript component does not have a method named: "getInterfaces"' when calling method: [nsIClassInfo::getInterfaces]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "JS frame :: http://bugzilla.mozilla.org/attachment.cgi? id=49359&action=view :: rewriteCallback :: line 38" data: no] Source File: http://bugzilla.mozilla.org/attachment.cgi?id=49359&action=view Line: 38 ************************ Error: uncaught exception: Permission denied to create wrapper for object Expected Results: Generated a page that has all the properties of the window variable in it. here is the JS function being called... function rewriteCallback() { //netscape.security.PrivilegeManager.enablePrivilege('AllPermissions'); var printer = ''; var win2 = window.open("about:blank"); win2.document.open(); for ( var xx in window ) { printer += xx+' = '; try { if (typeof window[xx] =='function' ) printer+='function\n'; else printer+=window[xx]+'\n'; } catch (e) { printer += e; } win2.document.writeln('<p>'+printer); printer=''; } win2.document.close(); }
-> js security (or should prompter not be showing up on an enumeration of the window object?)
Assignee: jst → mstoltz
Status: UNCONFIRMED → NEW
Component: DOM Level 0 → Security: CAPS
Ever confirmed: true
QA Contact: desale → bsharma
Summary: window.prompter cannot be wrapped → permission denied to create wrapper for window.prompter
What is prompter? At first glance, it should not be enumerable. /be
nsGlobalWindow#885 NS_IMETHODIMP GlobalWindowImpl::GetPrompter(nsIPrompt** aPrompt) { nsCOMPtr<nsIPrompt> prompter(do_GetInterface(mDocShell)); } re-cc'ing jst
Well enabling 'AllPermissions' won't work in this situation. Alpermission only applies to Java applets, actually, it gives no DOM permissions. Sorry, I know that's misleading. The permission that gives you all permissions in Javascript is 'UniversalXPConnect'. I should make these two equivalent; I'll file a bug on that. Note that your script needs to be signed or else run locally in order for enabling permissions to work. As for 'prompter,' is that part of the public API? Should it be? jst?
Status: NEW → ASSIGNED
Changing summary and reassigning to jst.
Assignee: mstoltz → jst
Status: ASSIGNED → NEW
Summary: permission denied to create wrapper for window.prompter → Should window.prompter be enumerable?
window.prompter was added by dougt when fixing bug 47889, but I don't see window.prompter being used anywhere in our JS (not in mozilla nor commercial), so we could mark it [noscript] and this bug would be fixed. Comments?
Doug, any objections to making nsIDOMWindow::prompter [noscript]?
Status: NEW → ASSIGNED
Component: Security: CAPS → DOM Level 0
OS: Windows 2000 → All
Hardware: PC → All
Whiteboard: [HAVE FIX]
Target Milestone: --- → mozilla0.9.6
fine with me. probably should have been noscript from the start.
Attached patch Proposed fix.Splinter Review
Comment on attachment 53694 [details] [diff] [review] Proposed fix. r=jkeiser
Attachment #53694 - Flags: review+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated QA contact
QA Contact: bsharma → desale
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: