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: prevent checking isDesktopCapturerEnabled, which crashes on electron@26 #154

Merged
merged 3 commits into from
Jun 5, 2023

Conversation

JuanIrache
Copy link
Contributor

No description provided.

@JuanIrache JuanIrache requested review from a team as code owners June 1, 2023 22:17
Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

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

I think we still want to check isDesktopCapturerEnabled on versions of Electron that still have that method.

E.g. features.isDesktopCapturerEnabled?.() I think will do that 👍

@miniak
Copy link
Contributor

miniak commented Jun 2, 2023

I think we still want to check isDesktopCapturerEnabled on versions of Electron that still have that method.

E.g. features.isDesktopCapturerEnabled?.() I think will do that 👍

In E26 the desktop capturer is always enabled, so it has to be if (features.isDesktopCapturerEnabled?.() !== false)

@JuanIrache
Copy link
Contributor Author

Of course. Should we do it like

if (!features || !features.isDesktopCapturerEnabled || features.isDesktopCapturerEnabled())

To keep the style consistent?

@erickzhao erickzhao changed the title Prevent checking isDesktopCapturerEnabled, which crashes on electron@26 fix: prevent checking isDesktopCapturerEnabled, which crashes on electron@26 Jun 2, 2023
@codebytere codebytere merged commit 9f543a1 into electron:main Jun 5, 2023
@continuous-auth
Copy link

🎉 This PR is included in version 2.0.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

@codebytere
Copy link
Member

Looks like this wasn't quite the right fix for this issue - it still errors when the function isn't defined. When features no longer contains isDesktopCapturerEnabled, !features.isDesktopCapturerEnabled evaluates to true, which then means the conditional checks the third condition: features.isDesktopCapturerEnabled() which throws an error:

Uncaught TypeError: features.isDesktopCapturerEnabled is not a function

taratatach added a commit to cozy-labs/cozy-desktop that referenced this pull request Mar 29, 2024
taratatach added a commit to cozy-labs/cozy-desktop that referenced this pull request Jul 29, 2024
taratatach added a commit to cozy-labs/cozy-desktop that referenced this pull request Aug 2, 2024
taratatach added a commit to cozy-labs/cozy-desktop that referenced this pull request Aug 2, 2024
taratatach added a commit to cozy-labs/cozy-desktop that referenced this pull request Sep 17, 2024
taratatach added a commit to cozy-labs/cozy-desktop that referenced this pull request Sep 17, 2024
taratatach added a commit to cozy-labs/cozy-desktop that referenced this pull request Sep 18, 2024
taratatach added a commit to cozy-labs/cozy-desktop that referenced this pull request Sep 18, 2024
taratatach added a commit to cozy-labs/cozy-desktop that referenced this pull request Sep 19, 2024
taratatach added a commit to cozy-labs/cozy-desktop that referenced this pull request Oct 2, 2024
taratatach added a commit to cozy-labs/cozy-desktop that referenced this pull request Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants