Closed Bug 196711 Opened 22 years ago Closed 22 years ago

javascript assignments to location and location.href fails with exception

Categories

(SeaMonkey :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: georg, Assigned: asa)

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030307 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030307 Typing: javascript:location.href='bioshop.de' into the location bar or using a bookmark, that writes to the location results in errormessages like this: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: javascript:location.href='bioshop.de' :: <TOP_LEVEL> :: line 1" data: no] This is a new bug. The bug occures with: Mozilla 1.4a Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030307 Reproducible: Always Steps to Reproduce: type javascript:location.href='bioshop.de' into the location bar and press ENTER Look to the JavaScript console Expected Results: no exception and changing the page
Mozilla 1.3 Branch isn´t affected, works fine with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030308
Worksforme with Linux trunk build 2003-03-09-05
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030315 This works well too. So the bug seems to be present only in one or a few nightly builds some days ago, but not in actual builds. I think we can assume that the bug is fixed.
On Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030406 I get Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: javascript:location.href='bioshop.de' :: <TOP_LEVEL> :: line 1" data: no] In a different situation I get a similar but **different**(?) problem: Javascript Console : Error: uncaught exception: Permission denied to get property Function.href happens at the call of function cgicmd(compte, action, param) { locstring = "/cgi-bin/cgipat.exe?compte=" + compte + "&valo=1"; location.href = locstring; } (on a SSL connexion)
For the same initial test case (javascript:location.href='bioshop.de' into the location bar) on Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030406 I get the following exception and nothing happens in the browser window Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: javascript:location.href='bioshop.de' :: <TOP_LEVEL> :: line 1" data: no]
here the exception comes if I type the following: javascript:location.href='bishop.de#Something' Without "#Something", it works. And with "#Something" worked with v1.3!
Sorry, I forgot to post my Mozilla-version: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4a) Gecko/20030401
Build Windows EN 2003050211: I'm not sure that the new behavior is right: Open a new window with the start page being "www.mozilla.org/start/" Paste in the location bar "javascript:location.href='bioshop.de'" Enter I get in the location bar : http://www.mozilla.org/start/bioshop.de (location appended to the URL) and no more exception in the JavaScript Console. in comment #4 I had trouble with -------- Javascript Console : Error: uncaught exception: Permission denied to get property Function.href happens at the call of function cgicmd(compte, action, param) { locstring = "/cgi-bin/cgipat.exe?compte=" + compte + "&valo=1"; location.href = locstring; } ---------- It doesn't happen any more with this build
> I get in the location bar : http://www.mozilla.org/start/bioshop.de Which is what you asked for, since "bioshop.de" is a relative URL. Did mstolt's recent changes to relax some security stuff fix this bug?
What are you doing there in your experiments? http://www.mozilla.org/start/bioshop.de results in a 404 File not found error. Mozilla.org has no page called bioshop.de I think, this bug is invalid, because I did not understand the meaning of the error message. The error was the relative URL used by the little JavaScript without protocol, which is not appended automatically by the DOM like is done by the location bar it self, when I do not use JavaScript. So I made a mistake. Mozilla said, that I made a mistake, but the cryptic error message did not help me to see, that I did the error. So, if there is a bug, then the bug is, that the error message is not human readable.
I believe that your original description is still valid, and there was an exception that shouldn't have been there. It happens that the valid result isn't the result that you were expecting, but there was a bug (and that's how I came to your bug report, looking for a report on an issue I had: I also experimented trouble with the web site of my bank for example, it was unusable because of that bug. And now it is working again). Then I believe it is fixed, though nobody seem to know by which change in the code (and it can happen..., and it is probably not worth looking for it)
The original uri, when I detected the problem, was this: javascript:var p=prompt('Seite');if(p)location='http://granne.bioshop.de/cgi-bin/gmL?domain=dhtml-tutorial&webpage='+p; This was saved as a bookmark. But this bug is fixed. It was related only to one single or a few builds. The test case I posteted the bug, was simplified by me. But this this simplified test case still reports the exception and this exception thrown by the simplified test case is correct. The simplified test case from my originatiing posting is wrong! In relation to the simplified test case the bug is invalid. In relation to the real bookmark code, the bug is fixed.
OK, the reporter says this is fixed.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.