Closed Bug 289456 Opened 19 years ago Closed 19 years ago

[FIXr]Uncaught Exception while trying to assign value to location.href (0x804b000a, NS_ERROR_MALFORMED_URI)

Categories

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

defect

Tracking

()

VERIFIED FIXED
mozilla1.8beta2

People

(Reporter: By-Tor, Assigned: bzbarsky)

References

()

Details

(Keywords: regression)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050407 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050407 Firefox/1.0+

While trying to access http://sony.storagesupport.com if you try to select
something from the dropdown and click go, nothing will happen, but the
Javascript console will show: Error: uncaught exception: [Exception...
"Component returned failure code: 0x804b000a [nsIDOMLocation.href]"  nsresult:
"0x804b000a (<unknown>)"  location: "JS frame :: http://sony.storagesupport.com/
:: formHandler :: line 72"  data: no]

This problem was introduced sometime in-between the 20050405 and 20050406 builds
of Firefox.

Reproducible: Always

Steps to Reproduce:
1. Go to http://sony.storagesupport.com
2. Select product from dropdown
3. Press Go

Actual Results:  
Error: uncaught exception: [Exception... "Component returned failure code:
0x804b000a [nsIDOMLocation.href]"  nsresult: "0x804b000a (<unknown>)"  location:
"JS frame :: http://sony.storagesupport.com/ :: formHandler :: line 72"  data: no]

Expected Results:  
Gone to the selected page.
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050407
Firefox/1.0+

confirming
->New
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
http://www.univision.com/portal.jhtml
press on "fotos del día" (bottomleft)

Error: uncaught exception: [Exception... "Component returned failure code:
0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.open]" nsresult: "0x80004005
(NS_ERROR_FAILURE)" location: "JS frame :: http://www.univision.com/portal.jhtml
:: openPhotoAlbum :: line 655" data: no]

and lots of others

CC Bzbarsky

Attached patch PatchSplinter Review
I thought I'd checked over the event compilation and made sure it uses the
owner document... Clearly I had not.  :(  The problem is that in our case the
event handler ended up compiled on the safe JS context (incorrectly), which
means the relative URI didn't resolve to an absolute URI.  The fix is to use
the OwnerDoc for event stuff, since attributes get set before the current
document does.
Assignee: general → bzbarsky
Status: NEW → ASSIGNED
Attachment #179981 - Flags: superreview?(jst)
Attachment #179981 - Flags: review?(jst)
We want this for 1.8b2... otherwise all sorts of event handlers will do the
wrong things.
Blocks: 286000
Flags: blocking1.8b2?
Priority: -- → P1
Summary: Uncaught Exception while trying to assign value to location.href → [FIX]Uncaught Exception while trying to assign value to location.href
Target Milestone: --- → mozilla1.8beta2
Blocks: 253735
(In reply to comment #4)
> We want this for 1.8b2... otherwise all sorts of event handlers will do the
> wrong things.

Would that include the numerous times I'm getting the following error too?

Error: [Exception... "'Permission denied to call method Window.eval' when
calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)"  location: "<unknown>"  data: no]
Quite possibly, yes.  If you have a testcase showing the problem, let me know
and I'll test this patch on it.
I can confirm that this patch fixes the problem...on www.hometheaterforum.com,
the drop-down boxes to navigate through the forum were throwing the exception
before and not working.  With the patch, there is nothing in the console, and
the drop-downs work just fine.

Build ID: Mozilla/5.0 (Windows; compatible; U; Windows NT 5.1; en-US; rv:1.8b2)
Gecko/20050408 Firefox/1.0+

(My own build)
(In reply to comment #6)
> Quite possibly, yes.  If you have a testcase showing the problem, let me know
> and I'll test this patch on it.

The closest I can come to a test case is the following code in my router's setup:
<SCRIPT LANGUAGE=JavaScript><!--
function GURL(x){var t=new Date(); location=x+'&ZT='+t.getTime();}
function makesure(p,l){if (confirm(p)) GURL(l);}
//--></SCRIPT>

This results in the following error:
Error: [Exception... "'Permission denied to get property XULElement.accessKey'
when calling method: [nsIDOMXULLabelElement::accessKey]"  nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)"  location: "JS frame ::
http://192.168.0.1/atbox.htm :: makesure :: line 3"  data: no]
Source File: http://192.168.0.1/atbox.htm
Line: 3
*** Bug 289584 has been marked as a duplicate of this bug. ***
Testcase added:
When you select the complete URL everything is oke. When you go to the relative
URL you should get a 404 Page not found, but you get a JS error instead.
Blocks: 289592
Yeah, those are both fixed by this patch
Blocks: 289687
Summary: [FIX]Uncaught Exception while trying to assign value to location.href → [FIX]Uncaught Exception while trying to assign value to location.href (0x804b000a, NS_ERROR_MALFORMED_URI)
Comment on attachment 179981 [details] [diff] [review]
Patch

r+sr=jst
Attachment #179981 - Flags: superreview?(jst)
Attachment #179981 - Flags: superreview+
Attachment #179981 - Flags: review?(jst)
Attachment #179981 - Flags: review+
Summary: [FIX]Uncaught Exception while trying to assign value to location.href (0x804b000a, NS_ERROR_MALFORMED_URI) → [FIXr]Uncaught Exception while trying to assign value to location.href (0x804b000a, NS_ERROR_MALFORMED_URI)
Comment on attachment 179981 [details] [diff] [review]
Patch

We want this for 1.8b2.  It's a safe fix; just make sure to use the right
document to compile event handlers.
Attachment #179981 - Flags: approval1.8b2?
Attachment #179981 - Flags: approval1.8b2? → approval1.8b2+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
*** Bug 289592 has been marked as a duplicate of this bug. ***
*** Bug 289699 has been marked as a duplicate of this bug. ***
No longer blocks: 289699
Flags: blocking1.8b2?
Verified FIXED using build Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8b2) Gecko/20050418 with the testcases listed in comment 0, comment 2,
comment 10 and http://netcenter.netscape.com (the latter's login code).
Status: RESOLVED → VERIFIED
(In reply to comment #17)
> Verified FIXED using build Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
> rv:1.8b2) Gecko/20050418 with the testcases listed in comment 0, comment 2,
> comment 10 and http://netcenter.netscape.com (the latter's login code).

Hello,

I am trying to use a feature in the http://www.quantummail.com website with Firefox 1.0.7 as my browser and it is not working. The error I am getting in the JavaScript console is the same as the one described in comment # 2, just making reference of course to the corresponding URI and file triggering the error. I read the previous comments and # 17 specifically talks about a fix for this kind of error but Firefox's latest version does not contain the fix yet, so I was wondering about the public availability of the fix. Please let me know if there is any scheduled release that will contain it.

Thanks.
> with Firefox 1.0.7 as my browser

That's a rendering engine from April 2004, with security fixes.  This bug was fixed on April 9, 2005.  So of course it doesn't work in Firefox 1.0.7.

The release candidate of Firefox 1.5 has this fix; you should try it out.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: