Skip to main content

detectBrowser module

this module called $browserChecker using a indepent script only in browser not awolled in node only detect browser & os sized max 1.1KB

example

<span id="os"></span>
<span id="browser"></span>
// this example using DOM traditional is valid using the neo-jquery $selector or $id

const osElement = document.querySelector('#os')
const browserElement = document.querySelector('#browser')

$browserChecker(osElement, browserElement)

browser

<!--main file-->
<script src="https://cdn.jsdelivr.net/npm/neo-jquery/browser/detectBrowser.js"></script>

core

/* CJS */
const { $browserChecker } = require('neo-jquery/core/detectBrowser')

/* ESM */
import { $browserChecker } from 'neo-jquery/core/detectBrowser'

/* Dynamic async/await and top level await */
const { $browserChecker } = await import('neo-jquery/core/detectBrowser')
desctype
params: $os & $browserCurrentElement
returnvoid

CurrentElement types

this type using HTMLElement or Element