Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evaluateAsync fails if Promise has been polyfilled on target page #1000

Closed
brendankenny opened this issue Nov 21, 2016 · 2 comments
Closed

Comments

@brendankenny
Copy link
Member

as discovered in #966, some sites will throw errors on all attempts to use driver.evaluateAsync with message Result of the evaluation is not a promise.

@a-xin found a demo site which, for now at least, reliably reproduces this behavior.

@brendankenny
Copy link
Member Author

brendankenny commented Nov 22, 2016

ah, so the issue is this site (and presumably the others) has a Promise polyfill that's overwriting the native Promise.

DevTools checks to see if the expression is a native promise, and throws an error otherwise. Since we're just evaluating to an unguarded Promise.resolve() or new Promise(), we're getting the polyfill and failing that check.

@brendankenny brendankenny changed the title evaluateAsync always throws on some sites evaluateAsync fails if Promise has been polyfilled on target page Nov 22, 2016
patrickhulce added a commit to patrickhulce/lighthouse that referenced this issue Nov 23, 2016
addresses GoogleChrome#1000 and GoogleChrome#976

1. Ensures all `Runtime.evaluate` calls result in the native Promise
2. Transforms all errors produced during the evaluation to a standard object that can be rejected by our driver wrapper
patrickhulce added a commit to patrickhulce/lighthouse that referenced this issue Nov 23, 2016
addresses GoogleChrome#1000 and GoogleChrome#976

1. Ensures all `Runtime.evaluate` calls result in the native Promise
2. Transforms all errors produced during the evaluation to a standard object that can be rejected by our driver wrapper
patrickhulce added a commit to patrickhulce/lighthouse that referenced this issue Nov 24, 2016
addresses GoogleChrome#1000 and GoogleChrome#976

1. Ensures all `Runtime.evaluate` calls result in the native Promise
2. Transforms all errors produced during the evaluation to a standard object that can be rejected by our driver wrapper
patrickhulce added a commit to patrickhulce/lighthouse that referenced this issue Nov 24, 2016
addresses GoogleChrome#1000 and GoogleChrome#976

1. Ensures all `Runtime.evaluate` calls result in the native Promise
2. Transforms all errors produced during the evaluation to a standard object that can be rejected by our driver wrapper
patrickhulce added a commit to patrickhulce/lighthouse that referenced this issue Nov 24, 2016
addresses GoogleChrome#1000 and GoogleChrome#976

1. Ensures all `Runtime.evaluate` calls result in the native Promise
2. Transforms all errors produced during the evaluation to a standard object that can be rejected by our driver wrapper
@brendankenny
Copy link
Member Author

fixed in #1037

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant