Skip to content

A browser detect library for .NET Standard

License

Notifications You must be signed in to change notification settings

MeilCli/DetectionCore

Repository files navigation

DetectionCore

Build Status NuGet version
A browser detect library for .NET Standard 2.0.

NuGet

NuGet

Install-Package DetectionCore

Detect

Browser

  • Internet Explorer
  • Microsoft Edge
  • Chrome
  • Firefox
  • Safari
  • Opera
  • NintendoBrowser
string userAgent = "mozilla/5.0 (Linux; Android 6.0.1; Nexus 5x build/mtc19t applewebkit/537.36 (KHTML, like Gecko) Chrome/51.0.2702.81 Mobile Safari/537.36";
if (userAgent.TryDetectBrowser(out BrowserType browserType, out string? browserDetail))
{
    Console.WriteLine($"BrowserType: {Enum.GetName(typeof(BrowserType), browserType)}"); // BrowserType: Chrome
    Console.WriteLine($"Browser: {browserDetail}"); // Browser: Chrome 51
}

Platform

  • Windows(each consumer version, over WindowsXP)
  • MacOS(each version, over Mac OS X v10.5)
  • Chrome OS
  • Ubuntu
  • Mint Linux
  • Fedora
  • Gentoo
  • FreeBSD
  • OpenBSD
  • NetBSD
  • Nintendo Wii
  • Nintendo WiiU
  • Nintendo Switch
  • Nintendo 3DS
  • PlayStation 2
  • PlayStation 3
  • PlayStation 4
  • PlayStation Vita
  • iOS
  • Android
  • Windows Phone
string userAgent = "mozilla/5.0 (Linux; Android 6.0.1; Nexus 5x build/mtc19t applewebkit/537.36 (KHTML, like Gecko) Chrome/51.0.2702.81 Mobile Safari/537.36";
if (userAgent.TryDetectPlatform(out PlatformType platformType, out string? platformDetail))
{
    Console.WriteLine($"PlatformType: {Enum.GetName(typeof(PlatformType), platformType)}"); // PlatformType: Android
    Console.WriteLine($"Platform: {platformDetail}"); // Android 6.0.1
}

Request Newer Detection

@MeilCli don't regularly use this library, but would like to add a new detection if requested.

Create Issue from Template

Develop Environment

  • C# 8.0
  • Visual Studio 2019 Preview
  • .NET Core 2.2 and 3.0

See Contributing Document

License

This library is under MIT License.

Using

About

A browser detect library for .NET Standard

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages