Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.

Commit

Permalink
Improved browser detection for #120
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed May 30, 2016
1 parent 71ee89a commit b4567b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/js/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
var newImage;

// Modern browsers (ignore Safari, #120 & #509)
if (image.naturalWidth && !IS_SAFARI) {
if (image.naturalWidth && !IS_SAFARI_OR_UIWEBVIEW) {
return callback(image.naturalWidth, image.naturalHeight);
}

Expand Down Expand Up @@ -268,7 +268,7 @@
orientation = dataView.getUint16(offset, littleEndian);

// Override the orientation with its default value for Safari (#120)
if (IS_SAFARI) {
if (IS_SAFARI_OR_UIWEBVIEW) {
dataView.setUint16(offset, 1, littleEndian);
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

// Supports
var SUPPORT_CANVAS = $.isFunction($('<canvas>')[0].getContext);
var IS_SAFARI = navigator && /safari/i.test(navigator.userAgent) && /apple computer/i.test(navigator.vendor);
var IS_SAFARI_OR_UIWEBVIEW = navigator && /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);

// Maths
var num = Number;
Expand Down

0 comments on commit b4567b9

Please # to comment.