Closed
Bug 122982
Opened 23 years ago
Closed 20 years ago
Permission denied to get property Window.scriptglobals
Categories
(Core :: Security, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: kevin.laevers, Assigned: security-bugs)
Details
Attachments
(2 files)
What:
We have several 'dynamic' pages, whose content is created on the fly, based
upon the users profile who logges on to SAP's 'workplace' solution.
Dynamic page 1 contains some javascript variables, and a few fields where you
can enter some text/make selections. When you press a 'submit' button, a
new 'Dynamic' page pops up, where you can select some options. After pressing
a 'submit' button, the values of the selections here set directly the
javascript variables of Dynamic page 1. That's when follow error occurs:
Error: uncaught exception: Permission denied to get property
Window.scriptglobals
We were trying to create an equivalent for Internet Explorer's
showMessageDialog method. We found it on
http://developer.netscape.com/viewsource/goodman_modal/goodman_modal.html'
which works fine! But on our dynamic pages, it's impossible to set the
javascript variables directly.
We only have a short amount of time left to finish this project, please help
Kevin
Below I wrote something similar to what we are trying to do, based upon your
solution for http://bugzilla.mozilla.org/show_bug.cgi?id=122317
The main page opens a new frameset. Both frames have a text field. The value
entered in frame 2 is sent to the javascript variable 'secondField' of the main
page, which works fine (because this is a 'static' page?). A function
helloFirstFrame() is called to display textfield 2's value in textfield 1.
This is a useless example, but it's all I could come up with ;0)
Kevin
<HTML>
<HEAD>
<title> Test Case for Netscape 6 JavaScript problem </title>
<SCRIPT LANGUAGE="JavaScript">
// Beginning of Javascript code.
var secondField = "";
function helloFirstFrame()
{ // We're just displaying the returned value in the text box of the upper
frame.
top.PopupWin2.topFrame.document.myControl.firstField.value = secondField;
}
var newTopDoc = "Top Frame updated"
var TopDoc = "<HTML><HEAD></HEAD>" +
"<BODY>\n" +
"<FORM NAME='myControl' onSubmit='return false;'>\n" +
"<TABLE CELLPADDING=0 CELLSPACING=1 BORDER=1 WIDTH=100%>" +
"<TR><TD>Top Frame</TD></TR>" +
"<TR><TD><INPUT TYPE='Text' NAME='firstField'></TD></TR>" +
"<TR><TD>Enter some text in the frame BELOW</TD></TR>" +
"</TABLE>\n" +
"</FORM>\n" +
"</BODY>\n" +
"</HTML>";
var newButtonDoc = "Button Frame updated"
var ButtonDoc = "<HTML><HEAD></HEAD>" +
"<BODY>" +
"<FORM NAME='myControl2' onSubmit='return false;'>\n" +
"<TABLE CELLPADDING=0 CELLSPACING=1 BORDER=1 WIDTH=100%>" +
"<TR><TD>Bottom Frame</TD></TR>" +
"<TR><TD><INPUT TYPE='Text' NAME='secondField'></TD></TR>" +
"<TR><TD>Text goes here</TD></TR>" +
"<TR><TD><INPUT TYPE=SUBMIT VALUE='SUBMIT'
onclick='javascript:parent.opener.secondField =
document.myControl2.secondField.value; parent.opener.helloFirstFrame
()'></TD></TR>" +
"<TR><TD>Press button to submit</TD></TR>" +
"</TABLE>\n" +
"</FORM>\n" +
"</BODY>" +
"</HTML>";
// POPUP A WINDOW AND BUILD THE FRAMESET
function createFrame(s_winTitle)
{
var theFrameset = "<HTML><HEAD><TITLE>" + s_winTitle
+ "    </TITLE>" +
"</HEAD>\n" +
"<FRAMESET ROWS='80,*' FRAMEBORDER='0'>\n" +
" <FRAME NAME='topFrame' marginheight='5'
SRC='javascript:parent.opener.TopDoc' SCROLLING='no'>\n" +
" <FRAME NAME='buttonFrame' marginheight='5'
SRC='javascript:parent.opener.ButtonDoc'>\n" +
"</FRAMESET>\n" +
"</HTML>";
top.PopupWin2 = window.open
("", 'jWindow' , 'width=300,height=205,resizable');
top.PopupWin2.document.write(theFrameset);
top.PopupWin2.focus();
}
// WRITE THE TOP FRAME
function doNothing()
{
}
// End of Javascript code.
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" ALINK="#FF0000"
VLINK="#FF0000">
<H4><FONT FACE="Arial, Helvetica">Test Case for Netscape 6.2 JavaScript Write()
problem</FONT></H4>
<P><FORM ACTION="" METHOD=POST name=aForm>
<A HREF="javascript:doNothing()" onclick="createFrame('My
Title')">> 1. Popup a frame set window
</A>
</FORM></P>
</BODY>
</HTML>
Comment 1•23 years ago
|
||
Reporter:
1. Please always specify which "Build ID" you're using.
2. This is not a "critical" bug ("crashes, loss of data, severe memory leak").
Thank you for using Bugzilla.
| Assignee | ||
Comment 2•23 years ago
|
||
I'm guessing this is the same problem as 122317. Please let me know which
version of Netscape/Mozilla you are running. (6.2? 6.2.1?)
| Assignee | ||
Comment 3•23 years ago
|
||
Please try applying the patch I posted to 122317, and see if that fixes your
problem. The patch adds a line to all.js.
| Reporter | ||
Comment 4•23 years ago
|
||
Hello,
I've tested my code under Mozilla 0.9.7 & the latest nightly build
0.9.8.20020220211, aswell as under Netscape 6.2.1.
The mentioned bug occurs on each of these browsers. I allready applied the
patch posted to bug 122317 to all browsers mentioned above, but this does not
solve the bug.
The code I included tries to simulate what we are doing, and gives us a
slightly different error than the one we have on our dynamic pages (Permission
denied to get property Window.scriptglobals), but as you now, it's hard to post
a dynamic, 'on the fly' created page ;0)
Kevin
Severity: critical → blocker
Tested the above html on the 2002-02-25-Trunk build and I do not get any
exception, but when I click on the link nothing happens. Is this the correct
behavior
Comment 6•23 years ago
|
||
This is the reporter's html example. bsharma, the example doing nothing may
have been caused by the inappropriate linefeeds that propably crept in the
example when submitted.
Comment 7•23 years ago
|
||
This attachment document.write()s the reporter's html into a new window, but I
guess that's not on-the-fly enough since it still wfm.
Updated•23 years ago
|
Severity: blocker → major
Comment 8•23 years ago
|
||
I am currently seeing a similar thing. One page creates a window, which later
calls opener.addOption(...). addOption is a function that I have defined within
script tags in the page body. However, the call fails and I get "Error:
uncaught exception: Permission denied to get property Window.addOption" in the
JS console. I am also calling the function from within script tags in the child
window's body.
Unfortunately, I can't reproduce the bug in a small bit of code. It has
happened erratically in the past, but is happening all the time right now.
Every simple example I create works fine. The pages that exhibit the error are
generated dynamically with Cold Fusion. I've inspected the resulting source,
and everything looks fine.
The pages work fine in Netscape 4.7 and IE6. Also, Mozilla is sometimes happy
with identical code (it's included from the same file), in other pages.
Build ID: 2002053012. Win2000 Pro.
Comment 9•23 years ago
|
||
I'm seeing exactly this problem... the application that demonstrates it is a
Java web-based application running on Tomcat. Using wget to retrieve and save
the page source and accessing it locally makes the issue go away. Even serving
these captured pages in Tomcat, using exactly the same URLs that were used to
retrieve them in the original test case, causes the problem to go away.
Substantially simplifying the application causes the problem to disappear as
well, but in an unpredictable way... making a change might solve the problem,
but then the change gets backed out and the problem will remain "solved", and
then later it will pop up with that change in place. Simpler pages seem to
make the issue less likely.
There are two possibilities that seem likely to me:
1. The problem has something to do with HTTP response headers generated by the
Apache Tomcat server for dynamically generated pages (something cache-related,
perhaps?).
2. The problem is a race condition, and the dynamically generated code happens
to be timed correctly to trigger it on a fairly regular basis.
I am unable to get this problem to occur when the server is running anywhere
other than localhost, which I tend to think lends credibility to the race
condition theory.
If anyone would like access to the Apache Tomcat web application that we use to
reproduce the problem, please contact me at chris@mindiq.com or by phone at 719-
473-0826. I cannot attach the application to the bug report where it would be
arbitrarily available, but I can release it to specific individuals involved in
the Mozilla project, and will be happy to provide help in getting a test
software environment set up for the purpose of reproducing this bug.
Comment 10•23 years ago
|
||
Is this related to bug 99454?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 11•23 years ago
|
||
Hmm...
Just downloaded Netscape 7, and it doesn't seem to exhibit this bug. I haven't
been keeping up with Mozilla, and don't know what Mozilla release Netscape 7 is
based on... or whether this bug really got fixed or was merely a race condition
masked by timing changes.
| Assignee | ||
Comment 12•22 years ago
|
||
Is this bug still happening? My guess is that it has gone away, because we don't
use "scriptglobals" to refer to global properties anymore, we refer to them by name.
Status: NEW → ASSIGNED
Comment 13•20 years ago
|
||
works for me in Firefox 1.0.4/winxpsp2
Comment 14•20 years ago
|
||
works for me in deer park 2005-06-13/winxpsp2. please reopen if you disagree.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•