New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 609409 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: May 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Command Line APIs are not defined in callbacks of promise.then() which returned by fetch()

Reported by l446240525@gmail.com, May 5 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2724.0 Safari/537.36

Steps to reproduce the problem:
fetch("").then(() => console.log($))

What is the expected behavior?
$ is defined

What went wrong?
See the attached screenshot

Did this work before? N/A 

Chrome version: 52.0.2724.0  Channel: n/a
OS Version: OS X 10.10.4
Flash Version: Shockwave Flash 22.0 r0
 
Screen Shot 2016-05-05 at 4.04.34 PM.png
97.1 KB View Download
same for XHR

var req = new XMLHttpRequest
req.open("get","")
req.onload = () => console.log($$)
req.send()

Comment 2 by alph@chromium.org, May 6 2016

Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Unconfirmed)
Status: WontFix (was: Assigned)
Thank you!

I think that it works as intended. We inject CommandLineAPI during console evaluation only. All asynchronous callbacks doesn't have injected CommandLineAPI:
setTimeout(() => console.log($$), 0);
setTimeout("console.log($$)", 0);
Promise.then(() => console.log($$));
You can store it to variable and pass it to callback manually:
let selector = $$;
setTimeout(() => console.log(selector));

Sign in to add a comment