Closed Bug 574033 Opened 14 years ago Closed 14 years ago

HUD Console should evaluate commands in window scope

Categories

(DevTools :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ozten, Assigned: julian.viereck)

Details

Attachments

(1 file)

My first instinct when using the HUD is to run code that treats the global scope as the content's window.

Repro:
1) Open a console on a page with jQuery included
2) Type $ into the console

Actual:
ReferenceError: $ is not defined

Expected:
Console would log the function and I'd know I could experiment with my page's content...

Workaround:
window.$ does work properly, but without a tooltip many people won't know (or want to) use window explicitly.
Note: This is not a proper fix for the problem but more a work around (it uses a with(window) { xxx } statement! That's evil, I know...).

This work around shouldn't be necessary anymore after bug 572953 is fixed, which is about dealing with the root of the problem. In the meantime, this is the best/easiest solution.
Assignee: nobody → jviereck
Status: NEW → ASSIGNED
Attachment #457875 - Flags: review?(dietrich)
Comment on attachment 457875 [details] [diff] [review]
[checked-in] Patch

i am a-ok with doing this until the platform issue is resolved. r=me.
Attachment #457875 - Flags: review?(dietrich) → review+
you really should add a TODO comment about removing "with" referencing the bug 572953
Whiteboard: [checked-in]
where was this checked in?
i don't think it was yet.
Whiteboard: [checked-in] → [checkin-needed]
Comment on attachment 457875 [details] [diff] [review]
[checked-in] Patch

changeset:   47920:8f6215091539
tag:         tip
user:        Julian Viereck <jviereck@mozilla.com>
date:        Mon Jul 19 10:51:51 2010 -0300
summary:     bug 574033 - HUD Console should evaluate commands in window scope
Attachment #457875 - Attachment description: Patch → [checked-in] Patch
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [checkin-needed]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: