P
P
Pogran2018-03-21 18:18:06
JavaScript
Pogran, 2018-03-21 18:18:06

How to find out that the user does not support the current code on the site?

The essence of the problem is this. Now the site has been updated and it turns out that users using opera mini and other old browsers see an error on the site. i.e. this technology stack is simply not supported by these users. the whole site is on react, requests go through fetch. all sorts of polyfills have already been delivered. that is, you need to somehow determine that the user has an old phone and transfer it to another version of the site. The difficulty is that I don’t know by what parameter to evaluate that the user has an old phone

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Stalker_RED, 2018-03-21
@Stalker_RED

if (!window.fetch) {
  console.log('тебе с нами не по дороге, старый телефон!')
  location.href = 'https://www.google.com/search?q=купи+телефон'
}
Approximately according to the same principle, you can check the rest of the features. And it's better than figuring out the phone model. On many old phones, you can also install new browsers.

V
Vitaly, 2018-03-21
@vshvydky

If it's only a fetch, it's enough to make a polyyil fetch

S
Sergey, 2018-03-21
@SaXXuM

You can google "outdated browser detection react".

V
Vladimir, 2018-03-21
@Casufi

I can recommend collecting errors using https://www.google.com/analytics/ then you will know on which devices and what specific errors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question