You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure which Chrome versions Ferrum is targeting, but async/await has been available since Chrome 62 which came out in October 2017. So if it is ok to not support javascript execution in Chrome older than 62, one solution which might work could be to just add async:
@erikaxel sounds good to me in general, though I don't like current JS API which was type of inherited from Poltergeist.
I say let's try if it works and doesn't break non-async function execution.
Describe the bug
Ferrum gives error on top level await calls in javascript
To Reproduce
Running the following javascript (through Cuprite, but the issue is in Ferrum):
will give
Expected behavior
It runs
Additional context
The same works if run through Selenium.
I'm pretty sure the problem is that the executable script is wrapped in a function in
ferrum/lib/ferrum/frame/runtime.rb
Line 84 in 19767d0
I'm not sure which Chrome versions Ferrum is targeting, but async/await has been available since Chrome 62 which came out in October 2017. So if it is ok to not support javascript execution in Chrome older than 62, one solution which might work could be to just add async:
If this is an acceptable solution I will be happy to provide a PR.
The text was updated successfully, but these errors were encountered: