Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent hacky tricks for iOS8 or greater #23

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion viewport-units-buggyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
var initialized = false;
var options;
var isMobileSafari = /(iPhone|iPod|iPad).+AppleWebKit/i.test(window.navigator.userAgent);
var iOSwithNotSupport = /Version\/(4|5|6|7)/i.test(window.navigator.userAgent);
var viewportUnitExpression = /([+-]?[0-9.]+)(vh|vw|vmin|vmax)/g;
var forEach = [].forEach;
var dimensions;
Expand Down Expand Up @@ -81,7 +82,7 @@
options = initOptions || {};
options.isMobileSafari = isMobileSafari;

if (!options.force && !isMobileSafari && !isOldInternetExplorer && (!options.hacks || !options.hacks.required(options))) {
if (!options.force && !isMobileSafari && !iOSwithNotSupport && !isOldInternetExplorer && (!options.hacks || !options.hacks.required(options))) {
// this buggyfill only applies to mobile safari
return;
}
Expand Down