Closed
Bug 103188
Opened 24 years ago
Closed 24 years ago
Should window.prompter be enumerable?
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla0.9.6
People
(Reporter: steve.toth, Assigned: jst)
Details
(Whiteboard: [HAVE FIX])
Attachments
(2 files)
|
1.02 KB,
text/html
|
Details | |
|
3.00 KB,
patch
|
john
:
review+
|
Details | Diff | Splinter Review |
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();
}
| Reporter | ||
Comment 1•24 years ago
|
||
| Reporter | ||
Updated•24 years ago
|
Comment 2•24 years ago
|
||
-> 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
Comment 3•24 years ago
|
||
What is prompter? At first glance, it should not be enumerable.
/be
Comment 4•24 years ago
|
||
nsGlobalWindow#885
NS_IMETHODIMP GlobalWindowImpl::GetPrompter(nsIPrompt** aPrompt)
{
nsCOMPtr<nsIPrompt> prompter(do_GetInterface(mDocShell));
}
re-cc'ing jst
Comment 5•24 years ago
|
||
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
Comment 6•24 years ago
|
||
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?
| Assignee | ||
Comment 7•24 years ago
|
||
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?
| Assignee | ||
Comment 8•24 years ago
|
||
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
Comment 9•24 years ago
|
||
fine with me. probably should have been noscript from the start.
| Assignee | ||
Comment 10•24 years ago
|
||
Comment 11•24 years ago
|
||
Comment on attachment 53694 [details] [diff] [review]
Proposed fix.
r=jkeiser
Attachment #53694 -
Flags: review+
| Assignee | ||
Comment 12•24 years ago
|
||
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•