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

fix: handle async execute on iOS without awaitPromise #199

Merged
merged 3 commits into from Feb 5, 2020

Conversation

imurchie
Copy link
Contributor

@imurchie imurchie commented Feb 5, 2020

On iOS 12.1 MobileSafari within a frame the window object gets reset (or we have a different window object?) when going through the atom. But since the code injected is known and stable, and also just retrieving values with no side effects, we can just run it directly.

`window.${promiseName}.resolve = res;` +
`window.${promiseName}.reject = rej;` +
`window.${promiseName};`;
const script = `var res, rej;` +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say quotes also support multiline strings, so pluses are redendant

@@ -419,41 +419,44 @@ class RemoteDebugger extends events.EventEmitter {
}

async executeAtomAsync (atom, args, frames) {
// helper to send directly to the web inspector
const evaluate = async (method, opts) => {
return await this.rpcClient.send(method, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return is not needed

@imurchie imurchie merged commit f558d4f into appium:master Feb 5, 2020
@imurchie imurchie deleted the isaac-execute-async-12.1 branch February 5, 2020 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants