mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Navigator check in browser checking.
This commit is contained in:
parent
4a0ac33f54
commit
92afe6752b
1 changed files with 4 additions and 2 deletions
|
@ -5,8 +5,10 @@ import Mapping from "./mapping";
|
||||||
import {replaceLinks} from "./utils/replacements";
|
import {replaceLinks} from "./utils/replacements";
|
||||||
import { EVENTS, DOM_EVENTS } from "./utils/constants";
|
import { EVENTS, DOM_EVENTS } from "./utils/constants";
|
||||||
|
|
||||||
const isChrome = /Chrome/.test(navigator.userAgent);
|
const hasNavigator = typeof (navigator) !== "undefined";
|
||||||
const isWebkit = !isChrome && /AppleWebKit/.test(navigator.userAgent);
|
|
||||||
|
const isChrome = hasNavigator && /Chrome/.test(navigator.userAgent);
|
||||||
|
const isWebkit = hasNavigator && !isChrome && /AppleWebKit/.test(navigator.userAgent);
|
||||||
|
|
||||||
const ELEMENT_NODE = 1;
|
const ELEMENT_NODE = 1;
|
||||||
const TEXT_NODE = 3;
|
const TEXT_NODE = 3;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue