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".
<rdar://problem/26639517>
This was tested on the latest Safari Tech Preview.
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.
(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.