Closed Bug 164169 Opened 22 years ago Closed 22 years ago

wiidening document.domain produces uncaught exception when readng form element value

Categories

(Core :: Layout: Form Controls, defect)

x86
Windows 2000
defect
Not set
critical

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: crsng1, Assigned: john)

References

()

Details

On Mozilla 1.1b Build ID: 2002072104 when widening document.domain, for example
setting document.domain="mydomain.com" in a page on server www.mydomain.com
produces the following error when trying to access the value of a form input
field, for example document.forms[0].elements[0].value :

Error: uncaught exception: Security Error: Content at
http://mydomain.com/page.htm may not load data from
http://www.mydomain.com/page.htm.

Here's a small example to repro bug (ajust mydomain.com). Just enter a value in
the input field and hit submit. Normally an alert box should display the element
value but instead it generates the error.

<html>
<head>
  <script language="JavaScript">
    document.domain = "mydomain.com"
  </script>
</head>
<body>
   <form onsubmit="alert (document.forms[0].elements[0].value);">
    <input name="test">
    <input type="submit">
  </form>
</body>
</html>

You can also try it out on http://www.netscript.com/extsnaps/mozilla/domain.htm
->
Assignee: rods → jkeiser
Problem fixed in Mozilla 1.1 / 20020826
marking so.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.