mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-09 08:46:35 +02:00
fix how we check if running in browser, fixes #609
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
"get-window": "^1.1.1",
|
"get-window": "^1.1.1",
|
||||||
"immutable": "^3.8.1",
|
"immutable": "^3.8.1",
|
||||||
"is-empty": "^1.0.0",
|
"is-empty": "^1.0.0",
|
||||||
|
"is-in-browser": "^1.1.3",
|
||||||
"keycode": "^2.1.2",
|
"keycode": "^2.1.2",
|
||||||
"react-portal": "^3.0.0",
|
"react-portal": "^3.0.0",
|
||||||
"selection-is-backward": "^1.0.0",
|
"selection-is-backward": "^1.0.0",
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
import browser from 'is-in-browser'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Browser matching rules.
|
* Browser matching rules.
|
||||||
*
|
*
|
||||||
@@ -43,7 +45,7 @@ let OS
|
|||||||
* Run the matchers when in browser.
|
* Run the matchers when in browser.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (process.browser) {
|
if (browser) {
|
||||||
const { userAgent } = window.navigator
|
const { userAgent } = window.navigator
|
||||||
|
|
||||||
for (const rule of BROWSER_RULES) {
|
for (const rule of BROWSER_RULES) {
|
||||||
|
Reference in New Issue
Block a user