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: properly pass openExternal activate option #18657

Merged
merged 4 commits into from Jun 10, 2019

Conversation

jeremyspiegel
Copy link
Contributor

Description of Change

A reference to an OpenExternalOptions structure was being captured by an Objective-C block that outlived the object that was being referenced (added in #15065). This caused the default browser window to not be activated when passing a URL on macOS when the default browser is Safari or Firefox. Fixes #18293.

cc @miniak @nornagon @alexeykuzmin @codebytere

Checklist

Release Notes

Notes: Fixed issue where shell.openExternal would not activate opened window on macOS

A reference to an OpenExternalOptions structure was being captured by an Objective-C block that
outlived the object that was being referenced.
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 5, 2019
@welcome
Copy link

welcome bot commented Jun 5, 2019

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@jeremyspiegel
Copy link
Contributor Author

Looks like I can't rely on a window onblur event in a test on CI (it worked when I ran it via npm run test). Not sure how else to test this, so maybe it'd be best to just revert the test change I made.

@jeremyspiegel
Copy link
Contributor Author

Hmm, I see now that with #17649, osx-testing-test doesn't pass on PRs from forks. I don't have permission to push a branch to this repo though.

@MarshallOfSound
Copy link
Member

@jeremyspiegel That's OK, as that's the only failure this PR is effectively green. Just needs a review 👍

@codebytere codebytere self-requested a review June 6, 2019 15:06
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 6, 2019
@codebytere
Copy link
Member

The failing macOS spec is expected for forks; merging.

@codebytere codebytere merged commit 64f7974 into electron:master Jun 10, 2019
@welcome
Copy link

welcome bot commented Jun 10, 2019

Congrats on merging your first pull request! 🎉🎉🎉

@release-clerk
Copy link

release-clerk bot commented Jun 10, 2019

Release Notes Persisted

Fixed issue where shell.openExternal would not activate opened window on macOS

@trop
Copy link
Contributor

trop bot commented Jun 10, 2019

I was unable to backport this PR to "5-0-x" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Jun 10, 2019

I was unable to backport this PR to "4-2-x" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Jun 10, 2019

I was unable to backport this PR to "6-0-x" cleanly;
you will need to perform this backport manually.

@codebytere
Copy link
Member

@jeremyspiegel could you please open manual backports for the targeted release lines?

@jeremyspiegel
Copy link
Contributor Author

@codebytere sure, but the bug is not in 4.2.x, it is new in 5.0.x.

@codebytere
Copy link
Member

@jeremyspiegel oops, corrected!

@trop
Copy link
Contributor

trop bot commented Jun 10, 2019

A maintainer has manually backported this PR to "5-0-x", please check out #18721

@trop
Copy link
Contributor

trop bot commented Jun 10, 2019

A maintainer has manually backported this PR to "6-0-x", please check out #18722

@sofianguy sofianguy added this to Fixed in 6.0.0-beta.7 in 6.1.x Jun 11, 2019
@sofianguy sofianguy added this to Fixed in 5.0.4 in 5.0.x Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
5.0.x
Fixed in 5.0.4
6.1.x
Fixed in 6.0.0-beta.7
Development

Successfully merging this pull request may close these issues.

shell.openExternal with Firefox as default browser not always getting focus
4 participants