@solid-primitives/platform
v0.1.2
Published
A set of const boolean variables identifying device and browser type.
Downloads
54,969
Readme
@solid-primitives/platform
A set of const boolean variables identifying device and browser type.
Installation
npm install @solid-primitives/platform
# or
pnpm add @solid-primitives/platform
# or
yarn add @solid-primitives/platform
How to use it
import { isWebKit, isFirefox } from "@solid-primitives/platform";
if (!isFirefox) {
// won't run on the Mozilla Firefox Browser
}
if (isWebKit) {
// run WebKit Engine specific code
}
Note: This package is tree-shakable, all unused variables will be removed from the bundle.
Note: On the server, all variables will be
false
.
List of variables
Device
isAndroid
— Is Android DeviceisWindows
— Is Windows DeviceisMac
— Is Mac DeviceisIPhone
— Is IPhone DeviceisIPad
— Is IPad DeviceisIPod
— Is IPod DeviceisIOS
— Is IOS DeviceisAppleDevice
— Is Apple DeviceisMobile
— is a Mobile Browser
Browser
isFirefox
— Browser is Mozilla FirefoxisOpera
— Browser is OperaisSafari
— Browser is SafariisIE
— Browser is Internet ExplorerisChromium
— is Chromium-based browserisEdge
— Browser is EdgeisChrome
— Browser is ChromeisBrave
— Browser is Brave
Rendering Engine
isGecko
— Browser using Gecko Rendering EngineisBlink
— Browser using Blink Rendering EngineisWebKit
— Browser using WebKit Rendering EngineisPresto
— Browser using Presto Rendering EngineisTrident
— Browser using Trident Rendering EngineisEdgeHTML
— Browser using EdgeHTML Rendering Engine
Changelog
See CHANGELOG.md