Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #363 from ftlabs/pr-257
Browse files Browse the repository at this point in the history
Add Firefox check — replaces PR #257
  • Loading branch information
matthew-andrews committed Jan 26, 2015
2 parents 776371d + 43fe1b5 commit 5da5801
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/fastclick.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@
var metaViewport;
var chromeVersion;
var blackberryVersion;
var firefoxVersion;

// Devices that don't support touch don't need FastClick
if (typeof window.ontouchstart === 'undefined') {
Expand Down Expand Up @@ -792,6 +793,18 @@
return true;
}

// Firefox version - zero for other browsers
firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];

if (firefoxVersion >= 27) {
// Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896

metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
return true;
}
}

// IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version
// http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx
if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
Expand Down

0 comments on commit 5da5801

Please sign in to comment.