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

ブラウザ版のmacOS判定がおかしいのを直す #1504

Merged

Conversation

Hiroshiba
Copy link
Member

内容

ブラウザ版のmacOS判定がおかしかったっぽいので直します。

関連 Issue

その他

electronだとprocessが必ず存在しているけど、process.platformはレンダラー側にはなさそう。
ここが以前の判定だと間違ってた。

chrome系は実験的機能だけどnavigator.userAgentDataが便利そう。
navigator.platformは非推奨機能だけどどのブラウザも実装しっぱなしなので一番これが利便性高そう。
ユーザーエージェントで判断するところまではだいたいのブラウザで来ない気がするけど、スマホをブラウザとかだと違うかもなので必ず値を返すように置いてます。

もし将来的にユーザーエージェントをしっかりと判定に使うようにするのであればUAParser.jsとかのライブラリを使うと良さそう。

@Hiroshiba Hiroshiba requested a review from a team as a code owner August 17, 2023 07:27
@Hiroshiba Hiroshiba requested review from y-chan and removed request for a team August 17, 2023 07:27
Copy link
Member

@y-chan y-chan left a comment

Choose a reason for hiding this comment

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

LGTM!
大丈夫だと思います!

@Hiroshiba Hiroshiba merged commit 9bf78c7 into main Aug 17, 2023
@Hiroshiba Hiroshiba deleted the ブラウザ版のmac判定がおかしいのを直す branch August 17, 2023 14:45
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