How to define browser options such as history API, localStorage, etc. At the first request?

Is there a way to detect browser features like History API, localStorage, etc. upon the first request received from the client on the server, so that I can customize the data of the response page in accordance with the functions of the browser?

I know how to do this while the page is loading (I use it using the Modernizr JS library).

+4
source share
1 answer

You can set a cookie when loading the first page. If the specified cookie does not exist, check for features. Pseudo:

 if(feature_cookies_does_not_exist) { check_for_features() create_feature_cookie() } 
0
source

Source: https://habr.com/ru/post/1434534/


All Articles