Closed Bug 726940 Opened 12 years ago Closed 12 years ago

Evaluating top.location='some url' in Error Console will open the url INSIDE Error Console

Categories

(Toolkit Graveyard :: Error Console, defect)

13 Branch
x86
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: mihaelav, Unassigned)

Details

Mozilla/5.0 (Windows NT 6.1; rv:13.0a1) Gecko/20120213 Firefox/13.0a1

STR:
1. Open Error Console
2. Type top.location='http://mozilla.org/' (or any other URL; e.g: 'file:///c:/', 'about:config', etc)
3. Hit Enter/Press "Evaluate"

Actual result:
The page from the URL in step 2 will be opened INSIDE Error Console. One cannot go back to Error console, unless opening again from menu (or closing and opening again with keyboard shortcuts)

Expected result: 
The expression should be evaluated; provided url should not open in Error Console

Note:
Reproducible back to Firefox 3.6 (3.6.26)
Component: Developer Tools → Error Console
Product: Firefox → Toolkit
QA Contact: developer.tools → error.console
> The expression should be evaluated; provided url should not open in Error Console
INVALID? Working as designed (i.e. you shouldn't do that). Evaluating the expression *should* load the url into the chrome window. What did you expect evaluating the expression to do?
That was my initial reaction, too, but the suggestion in IRC was to display an error instead of modifying the error console window. It does sound reasonable for a dialog that is not made for browsing.
If evaluating |top.location='http://mozilla.org/'| doesn't produce an error in normal content code, then I don't think it should produce an error when run from evaluate in the Error Console. Since your javascript is running with chrome privileges in the evaluate box, top.location is equivalent to window.location. Which of course refers to the Chrome window of the Error Console.

You should use the Firefox web console to run such code in the context of a content web page. Then you won't be able to break out of the content window with "top".
Closing as INVALID => Working as designed.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.