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
,
May 6 2016
,
May 6 2016
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 |
|||
Comment 1 by l446240525@gmail.com
, May 5 2016same for XHR var req = new XMLHttpRequest req.open("get","") req.onload = () => console.log($$) req.send()