Skip to content

Commit

Permalink
Merge pull request #4665 from mozilla/fix-browser-detect
Browse files Browse the repository at this point in the history
Fix browser detection code in node.js
  • Loading branch information
brianpeiris authored Sep 23, 2021
2 parents b70074a + ee79e1b commit 52f293e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/detect-safari.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import { detect } from "detect-browser";

export function isSafari() {
const browser = detect();
return ["iOS", "Mac OS"].includes(browser.os) && ["safari", "ios"].includes(browser.name)
if (!browser) return false;
return ["iOS", "Mac OS"].includes(browser.os) && ["safari", "ios"].includes(browser.name);
}

0 comments on commit 52f293e

Please sign in to comment.