Closed Bug 305546 Opened 19 years ago Closed 18 years ago

alert() from javascript: URL dragged to New Window button comes from nowhere

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: bzbarsky)

References

()

Details

Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b4) Gecko/20050821
Firefox/1.0+ ID:2005082116

Steps to reproduce:
1. Add the "New Window" button to your toolbar.
2. Drag the following text to it: javascript:alert(12345)

Result: An alert appears from nowhere (near the top left of my screen), then a
new browser window appears.

Expected: The browser window should appear first, and the alert should be a
sheet on that window.
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/browser/base/content/browser.js&rev=1.488&mark=600#568

This isn't specific to the New Window icon, it happens anytime you try to open a
javascript: link in a new window (via the open location dialog, for instance).
The loadURI call in browser.js happens onLoad, so I'm not sure that this is
something that can really be fixed... short of moving that to delayedStartup,
which would have a pretty bad effect on page load time.
OS: MacOS X → All
Hardware: Macintosh → All
Version: 1.5 Branch → unspecified
This can be triggered by websites with e.g.

  window.open("javascript:alert(4)");

assuming the popup goes into a window and not a tab.

dveditz says "odd, but not dangerous".   I think I agree.
Depends on: 351633
Checkin for bug 351633 fixed this.
Assignee: nobody → bzbarsky
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.