Closed Bug 41707 Opened 24 years ago Closed 24 years ago

Javascript URLs don't work (WAS: Javascript bug prompts don't work)

Categories

(Core :: Networking, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: akkzilla, Assigned: mscott)

References

()

Details

(Keywords: regression, Whiteboard: [nsbeta2+])

Attachments

(1 file)

I have a bug prompt URL which I use all the time in 4.7 so that I don't have to
wait for the bugzilla main page to load (adapted from something German sent
around a while ago) but it doesn't work in mozilla: it gives an "Error loading
URL" message on the console and no UI error message.

See the URL field for the one I've been using.  I also tried simplifying it to:
javascript:{key=prompt('Bug number',''); if(key != null){document.location=
'http://bugzilla.mozilla.org/show_bug.cgi?id='+key;}}
(which I like better, but the longer one is the one I've been using in 4.7 so I
left that in the URL field) but that doesn't work either.

This is a regression: this bookmark worked in mozilla a few months ago.
Keyword: regression.  Also adding nsbeta2 because while it isn't really dogfood,
the lack of this makes bugzilla access a lot more painful and this may also
point to a problem that might cause problems on heavily JS-oriented sites.
Keywords: nsbeta2, regression
Putting on [nsbeta2+] radar for beta2 fix. 
Whiteboard: [nsbeta2+]
UPDATE:
 
Using Mozilla debug Linux and Windows builds made on 06/21/00, 06/20/00,
I can't even get this simple JavaScript URL to work:

                  javascript: {alert('Hello');}


Steps to reproduce: 

1. Bring up Mozilla with some http:// URL
2. Type in the above JavaScript URL and hit Enter

Expected result: the alert should come up (as it does in NN4.x and IE4)
Actual Result: the alert does not come up. In the JavaScript console:
 
      Entry at index 0 is javascript: alert('Hello');
      JavaScript error:
       line 0:

      Enabling Quirk StyleSheet
      Document: Done (0.594 secs)
      "Error loading URL javascript: alert('Hello');"


If I launch Mozilla from the console and pass the JavaScript URL 
DIRECTLY to it as an argument, like this:

      ./mozilla "javascript: alert('Hello');"


the alert DOES come up! Once the alert is dismissed, however, 
we see this again in the console:

      "Error loading URL javascript: alert('Hello');"

We do not see the other error above, however: 

      "JavaScript error:
        line 0: "

Note: is this bug a dup of bug 34217? 
Summary: Javascript bug prompts don't work → Javascript URLs don't work (WAS: Javascript bug prompts don't work)
Reassigning to Networking (as in bug 34217)
Assignee: rogerl → gagan
Component: Javascript Engine → Networking
QA Contact: pschwartau → tever
Also compare bug 37463 (lockup/freeze upon javascript: Window.Location = etc.)
*** Bug 43598 has been marked as a duplicate of this bug. ***
this might be a dup/regression of bug 34217. I would let warren confirm that...
Assignee: gagan → warren
Have you tried to reproduce this? I think it's fixed.
Assignee: warren → gagan
Not fixed as of 6/26: the prompt comes up, I type in the bug number, and the app
freezes and has to be killed.
*** Bug 43918 has been marked as a duplicate of this bug. ***
*** Bug 43786 has been marked as a duplicate of this bug. ***
warren: this still happens. giving this to mscott per your suggestion.
Assignee: gagan → mscott
I fixed a bug that was recently introduced in the file transport that was 
preventing the "retval undefined" error from being returned to the consumer, but 
looking through the doc loader / docshell code, it only appears this error is 
checked in one place -- after the NS_OpenURI call which seems wrong. It needs to 
be checked in OnStartRequest before the current document is torn down. 

This used to work -- I remember fixing it. I'm guessing Travis broke it 
somewhere along the line.
Thanks for the heads up warren. I'll take a look at adding the check in the on
start request for the uri loader. 
Target Milestone: --- → M17
Attached patch proposed fixSplinter Review
This turned out to be very easy. Warren or gagan, can one of you guys review the
fix for me? I have a method which detects if I should supress the on start (or
on stop, on data avaiable) calls called ProcessCanceledCase. I just expanded it
to check if we received NS_ERROR_DOM_RETVAL_UNDEFINED as well.

Akkana's JS url example works for me after this change.
I've checked in the uriloader fix for this. it fixes Akkana's javascript url
example.

However, many urls still don't work because of 43652. I have a fix in that bug
that I'm waiting on a code review for then I'll check that in too. 
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
JavaScript URLs are still broken - 
Steps to reproduce: see my comments above from 2000-06-22.

Using Mozilla tip builds 07/11/2000 on WinNT, Linux, and Mac0S9.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
We may need to open a new bug on the JS engine for this. All of this worked on
7/6 when I landed the fix. Something broke between then and today's bits. It
looks like the problem has nothing to do with the uriloader (which was the
problem with this bug originally). The return value is getting processed
properly. Everything looks good except for the actual execution of the JS.
In fact it seems like the JS engine is just failing to do complex JS things like
bringing up alert and prompt dialogs. I'm able to do simple stuff like
javascript:('foo');

It doesn't look like an Engine problem: notice this comment from 6/22.
This is still occurring now. If the Engine were incapable of bringing up
alerts, this wouldn't work, but it does.

It makes it seem that the part of the browser responsible for delivering
commands from the URL bar to the engine is not working properly.



"If I launch Mozilla from the console and pass the JavaScript URL
 DIRECTLY to it as an argument, like this:

      ./mozilla "javascript: alert('Hello');"


 the alert DOES come up! Once the alert is dismissed, however,
 we see this again in the console:

      "Error loading URL javascript: alert('Hello');"

 We do not see the other error above, however:

      "JavaScript error:
        line 0: "

there's a JS principals problem with javascript urls typed into the urlbar which
was recently exposed. That is what's causing this problem. I have a fix and am
getting it reviewed by the JS security team now.

Instead of filing a new bug I'm just going to use this one.
I checked in a fix for the owner problem where JS and data urls entered in the
urlbar were not getting the owner set on them correctly. This prevented the
alert test from working because the url didn't have the right principals set on it.

mstoltz reviewed the fix.

Please ignore the warning: "Error loading URL javascript: alert('Hello');"
That's bogus. The way we run JS urls, we end up canceling them after they start
loading. Someone is reporting a false warning about an error on the load because
we cancel it.

The test cases in this bug now work again.
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
verified:
Linux 2000071308
winNT 2000071308
Mac os8.6 2000071308
Status: RESOLVED → VERIFIED
*** Bug 43786 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: