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

delay window.focus() when needed #3246

Merged
merged 2 commits into from
Feb 16, 2019

Conversation

gdh1995
Copy link
Contributor

@gdh1995 gdh1995 commented Feb 16, 2019

On Chrome, if an extension's content script call window.focus()
during Port.onMessage handlers, then Chrome will activate the tab.
Therefore there's a race condition between:

  • tabs.update(tabId, {active:true} in main.coffee
  • and focusThisFrame -> window.focus() in vimium_frontend.coffee

In my tests, a setTimeout is just enough to avoid this activating, so this PR should fix #3242.

On Chrome, if an extension's content script call window.focus()
  during Port.onMessage handlers, then Chrome will activate the tab.
Therefore there's a race condition causing philc#3242.

In my tests, a `setTimeout` is just enough to avoid this activating.
@smblott-github smblott-github merged commit df867ac into philc:master Feb 16, 2019
@smblott-github
Copy link
Collaborator

Thanks, @gdh1995.

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.

Focus switches randanly after using Vomnibar.activateInNewTab command in chrome 72.
2 participants