Shyjus.BrowserDetector 1.1.1

.NET Standard 2.0
There is a newer version of this package available.
See the version list below for details.
dotnet add package Shyjus.BrowserDetector --version 1.1.1
NuGet\Install-Package Shyjus.BrowserDetector -Version 1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Shyjus.BrowserDetector" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Shyjus.BrowserDetector --version 1.1.1
#r "nuget: Shyjus.BrowserDetector, 1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Shyjus.BrowserDetector as a Cake Addin
#addin nuget:?package=Shyjus.BrowserDetector&version=1.1.1

// Install Shyjus.BrowserDetector as a Cake Tool
#tool nuget:?package=Shyjus.BrowserDetector&version=1.1.1

How to use ?

Step 1: Install the BrowserDetector nuget package

Install-Package Shyjus.BrowserDetector

Step 2: Enable the browser detection service inside the ConfigureServices method of Startup.cs.

public void ConfigureServices(IServiceCollection services)
    // Add browser detection service


Step 3: Inject IBrowserDetector to your controller class or view file or middleware and access the Browser property.

Example usage in controller code

public class HomeController : Controller
    private readonly IBrowserDetector browserDetector;
    public HomeController(IBrowserDetector browserDetector)
        this.browserDetector = browserDetector;
    public IActionResult Index()
        var browser = this.browserDetector.Browser;
        // Use browser object as needed.

        return View();

Example usage in view code

@inject Shyjus.BrowserDetection.IBrowserDetector browserDetector

<h2> @browserDetector.Browser.Name </h2>
<h3> @browserDetector.Browser.Version </h3>
<h3> @browserDetector.Browser.OS </h3>
<h3> @browserDetector.Browser.DeviceType </h3>

Example usage in custom middlware

You can inject the IBrowserDetector to the InvokeAsync method.

public class MyCustomMiddleware
    private RequestDelegate next;
    public MyCustomMiddleware(RequestDelegate next)
    { = next;
    public async Task InvokeAsync(HttpContext httpContext, IBrowserDetector browserDetector)
        var browser = browserDetector.Browser;

        if (browser.Type == BrowserType.Edge)
            await httpContext.Response.WriteAsync("Have you tried the new chromuim based edge ?");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Shyjus.BrowserDetector:

Package Downloads

Package Description


Package Description


Package Description


An easy to use library with all the features you need.


An easy to use library with all the features you need.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Shyjus.BrowserDetector:

Repository Stars
.Net 6.0 、SqlSugar、Vue、RBAC、前后端分离的开箱即用的企业级中后台管理系统
Version Downloads Last updated
2.0.0 280,486 5/23/2021
1.1.1 155,650 2/19/2020
1.1.0 726 2/19/2020
1.0.9 973 1/24/2020
1.0.8 10,930 9/13/2019
1.0.7 467 9/7/2019
1.0.6 480 9/7/2019
1.0.5 477 8/31/2019
1.0.4 486 8/30/2019
1.0.3 479 8/30/2019
1.0.2 467 8/30/2019
1.0.1 461 8/30/2019
1.0.0 531 8/30/2019

Signing the assembly.