Bug 158385 - REGRESSION: $1 doesn't work in console after selecting an element in jsfiddle
Summary: REGRESSION: $1 doesn't work in console after selecting an element in jsfiddle
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-06-04 15:53 PDT by Ryosuke Niwa
Modified: 2016-12-13 15:33 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2016-06-04 15:53:02 PDT
Reproduction steps:
1. Open https://jsfiddle.net/kLtkjmLe/
2. Inspect "y" in the view
3. Type "$1"

Expected result:
I can access the selected element.

Actual result:
Get "ReferenceError: Can't find variable".
Comment 1 Radar WebKit Bug Importer 2016-06-04 15:53:21 PDT
<rdar://problem/26639517>
Comment 2 Ryosuke Niwa 2016-06-04 15:58:34 PDT
This was tested on the latest Safari Tech Preview.
Comment 3 Timothy Hatcher 2016-06-04 17:33:01 PDT
You need to pick the result frame in the console context selector on the right side for $1 to work.

We should auto switch this based on the selected frame/element in the DOM tree I think. I'm pretty sure we have other bugs about this.
Comment 4 Ryosuke Niwa 2016-06-06 01:09:00 PDT
(In reply to comment #3)
> You need to pick the result frame in the console context selector on the
> right side for $1 to work.
> 
> We should auto switch this based on the selected frame/element in the DOM
> tree I think. I'm pretty sure we have other bugs about this.

I didn't know there was such a thing. I agree it would be great to automatically switch the context.