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: bind fake mojo service for badging #25294

Merged
merged 2 commits into from Sep 8, 2020
Merged

Conversation

codebytere
Copy link
Member

Description of Change

Closes #25141.

Bind a fake mojo service for the Badging API. When users add e.g. navigator.setAppBadge(42) to the renderer, they will now see

The Chromium Badging API is not available in Electron

logged as a warning.

cc @nornagon @MarshallOfSound @deepak1556

Checklist

Release Notes

Notes: Fixed a crash in the renderer process when invoking the Badging API.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Sep 3, 2020
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.

Quick test? 😄

Copy link
Member

@nornagon nornagon left a comment

Choose a reason for hiding this comment

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

Is it possible we could actually support the badging service? We do expose the relevant APIs...

@codebytere
Copy link
Member Author

@nornagon not as it stands without massive patching, given that the Chromium impl is per-Profile.

For now, i think in the short term we should mitigate this crash, although I do think there are some paths forward here. At minimum, we should look towards adding badging support for Windows. Once that's done, I think we can look to bind this to our own badging APIs 🤔 I can open a follow-up issue about adding Windows support if that seems like something we feel would be the next best step.

@nornagon
Copy link
Member

nornagon commented Sep 3, 2020

Can we expose the events to the main process and let the app figure it out?

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Sep 4, 2020
@codebytere
Copy link
Member Author

Potentially? Wiring up the events would almost certainly require a fair bit of patching as well, and at that point it seems more prudent to actually support badging on Windows and wire it up more properly 🤔

@nornagon
Copy link
Member

nornagon commented Sep 4, 2020

I think it still makes sense to give the app control over what's allowed to badge, for instance.

@zcbenz
Copy link
Member

zcbenz commented Sep 8, 2020

I assume it is OK to merge this PR? Providing some APIs to implement navigator.setAppBadge would be great, but this PR is only about fixing a crash and does not conflict with that purpose.

@jkleinsc jkleinsc merged commit f6df79b into master Sep 8, 2020
@release-clerk
Copy link

release-clerk bot commented Sep 8, 2020

Release Notes Persisted

Fixed a crash in the renderer process when invoking the Badging API.

@trop
Copy link
Contributor

trop bot commented Sep 8, 2020

I have automatically backported this PR to "10-x-y", please check out #25369

@trop trop bot removed the target/10-x-y label Sep 8, 2020
@trop
Copy link
Contributor

trop bot commented Sep 8, 2020

I have automatically backported this PR to "11-x-y", please check out #25370

@trop
Copy link
Contributor

trop bot commented Sep 8, 2020

I have automatically backported this PR to "9-x-y", please check out #25371

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.

Renderer crash after calling navigator.setAppBadge(42)
6 participants