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

RESOLVED INVALID

Status

RESOLVED INVALID
7 years ago
2 years ago

People

(Reporter: mihaelav, Unassigned)

Tracking

13 Branch
x86
Windows 7

Details

(Reporter)

Description

7 years ago
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

Comment 1

7 years ago
> 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.

Comment 3

7 years ago
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".

Comment 4

7 years ago
Closing as INVALID => Working as designed.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INVALID
(Assignee)

Updated

2 years ago
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.