Navigator


How to use the Navigator class of the bit Butil?

Usage
To use the browser navigator features you need to inject the Bit.Butil.Navigator class and use it like this:
@inject Bit.Butil.Navigator navigator

@code {
    var userAgent = await navigator.GetUserAgent();
}
Methods

GetDeviceMemory:
Returns the amount of device memory in gigabytes. This value is an approximation given by rounding to the nearest power of 2 and dividing that number by 1024 (MDN).



GetHardwareConcurrency:
Returns the number of logical processor cores available (MDN).



GetLanguage:
Returns a string representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown (MDN).



GetLanguages:
Returns an array of strings representing the languages known to the user, by order of preference (MDN).



GetMaxTouchPoints:
Returns the maximum number of simultaneous touch contact points are supported by the current device (MDN).



IsOnLine:
Returns a boolean value indicating whether the browser is working online (MDN).



IsPdfViewerEnabled:
Returns true if the browser can display PDF files inline when navigating to them, and false otherwise (MDN).



GetUserAgent:
Returns the user agent string for the current browser (MDN).



IsWebDriver:
Indicates whether the user agent is controlled by automation (MDN).


CanShare:
Returns true if a call to navigator.Share() would succeed (MDN).



ClearAppBadge:
Clears a badge on the current app's icon and returns a Promise that resolves with undefined (MDN).



SendBeacon:
Used to asynchronously transfer a small amount of data using HTTP from the User Agent to a web server (MDN).



SetAppBadge:
Sets a badge on the icon associated with this app and returns a Promise that resolves with undefined (MDN).



Share:
Invokes the native sharing mechanism of the current platform (MDN).



Vibrate:
Causes vibration on devices with support for it. Does nothing if vibration support isn't available (MDN).