How do I check if user is using Safari on the Windows? Because I need to apply some special styles to the site.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
This plugin seems to be exactly what you want. Plugin Link
On the plugin page they link to a test page that runs the plugin which will shoot back the browser and OS. Test Link
You can test
navigator.userAgent
for the stringsSafari/
andWindows
(list of Safari user agent strings), e.g.: Live Example...but browser detection is usually not the best solution to a problem. Much better, where you can, to use feature detection. You can feature-detect nearly everything. Kangax has a great list of feature detects, and of course libs like Moderizr do them as well. But I don't know your use-case...