Skip to content

Commit

Permalink
Added iOS safari 10 match
Browse files Browse the repository at this point in the history
  • Loading branch information
dengjeffrey committed May 7, 2018
1 parent aacace5 commit 837fc3f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/fontwatcher.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ goog.scope(function () {
if (FontWatcher.SHOULD_USE_NATIVE_LOADER === null) {
if (!!window.FontFace) {
var match = /Gecko.*Firefox\/(\d+)/.exec(FontWatcher.getUserAgent());
var safari10Match = /OS X.*Version\/10\..*Safari/.exec(FontWatcher.getUserAgent()) && /Apple/.exec(FontWatcher.getVendor());
var appleMatch = /Apple/.exec(FontWatcher.getVendor())
var safari10Match = /OS X.*Version\/10\..*Safari/.exec(FontWatcher.getUserAgent()) ||
/AppleWebKit\/603/.exec(FontWatcher.getUserAgent()) ||
/AppleWebKit\/602/.exec(FontWatcher.getUserAgent())

if (match) {
FontWatcher.SHOULD_USE_NATIVE_LOADER = parseInt(match[1], 10) > 42;
} else if (safari10Match) {
} else if (appleMatch && safari10Match) {
FontWatcher.SHOULD_USE_NATIVE_LOADER = false;
} else {
FontWatcher.SHOULD_USE_NATIVE_LOADER = true;
Expand Down

0 comments on commit 837fc3f

Please sign in to comment.