How to detect browser country in client site?

前端 未结 2 1868
孤独总比滥情好
孤独总比滥情好 2020-12-10 13:30

I found the following website can detect my country and currency even in the private mode

http://www.innisfreeworld.com/

It records in cookie, How do it do t

2条回答
  •  被撕碎了的回忆
    2020-12-10 13:48

    Another option could be using the (internationalization API)

    console.log(Intl.DateTimeFormat().resolvedOptions().timeZone)
    

提交回复
热议问题