Module: browser

Methods


<static> browserType()

AOS, IOS - type, version 정보 반환

Source:
Returns:
Type
IBrowserType
Example
import { browserType } from '@nonoll/code-snippet/browser';

console.log(browserType()); // { type, version }

<static> getPassiveOption()

실행된 browser 에서 지원하는 passive 옵션 값 반환

Source:
See:
Returns:
Type
IPassive | Boolean
Example
import { getPassiveOption } from '@nonoll/code-snippet/browser';
console.log(getPassiveOption()); // IPassive or false

<static> isAOS()

browser - AOS 유무 반환

Source:
Returns:
Type
Boolean
Example
import { isAOS } from '@nonoll/code-snippet/browser';
console.log(isAOS()); // true or false

<static> isCHROME()

browser - CHROME 유무 반환

Source:
Returns:
Type
Boolean
Example
import { isCHROME } from '@nonoll/code-snippet/browser';
console.log(isCHROME()); // true or false

<static> isIOS()

browser - IOS 유무 반환

Source:
Returns:
Type
Boolean
Example
import { isIOS } from '@nonoll/code-snippet/browser';
console.log(isIOS()); // true or false

<static> uaParser(parsingType [, start] [, end] [, ua])

uaParser

Parameters:
Name Type Argument Default Description
parsingType T

parsing 타입

start Number <optional>
1

version slice - start index

end Number <optional>
1

version slice - end index

ua String <optional>
window.navigator.userAgent
Source:
Returns:
Type
R
Example
import { uaParser, IBrowserType } from '@nonoll/code-snippet/browser';

const iosChromeParser = (): IBrowserType => {
  return uaParser<{CHROME: string}, IBrowserType>({CHROME: 'CriOS\/([0-9]+)?\\.?([0-9]+)\\.?([0-9]+)\\.?([0-9]+)?'}, 1, 6);
};

console.log(iosChromeParser()); // { type, version }

<static> vendorPrefix()

browser - vendorPrefix 반환

Source:
See:
Returns:
Type
IVendorPrefix
Example
import { vendorPrefix } from '@nonoll/code-snippet/browser';
console.log(vendorPrefix()); // {dom: "Webkit", lowercase: "webkit", css: "-webkit-", js: "Webkit"}

Type Definitions


BROWSER_AGENTS

Type:
  • String
Properties:
Name Type Description
AOS String

user agent pattern

IOS String

user agent pattern

Source:

IVendorPrefix

IVendorPrefix

Type:
  • TSInterface
Properties:
Name Type Description
dom string

dom 기준, prefix

lowercase string

소문자로 반환

css string

css 기준, prefix

js string

js 기준, prefix

Source: