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

Pass process.platform down to renderer process #100

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

sergeichestakov
Copy link
Contributor

Why

If we ever want to do anything OS-specific on the web side (for example, prompt Linux users to download the latest client), it's necessary to know which platform we're on. While we can potentially infer that from the user agent, I'd rather this be an explicit part of the API for ease of use and consistency (on the off-chance the heuristic we use differs from what Node uses).

What changed

Pass process.platform down to renderer process as a new platform field on the global replitDesktop object

Test plan

  • Start the app
  • Open dev tools console
  • Log that replitDesktop.platform exists and matches expected value

src/preload.ts Outdated Show resolved Hide resolved
src/preload.ts Outdated Show resolved Hide resolved
@sergeichestakov sergeichestakov merged commit f969a08 into main Aug 15, 2023
4 checks passed
@sergeichestakov sergeichestakov deleted the @sergeichestakov/platform-arg branch August 15, 2023 15:11
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.

2 participants