Skip to content

Instantly share code, notes, and snippets.

View DaveFlash's full-sized avatar

David Daniël Wouters DaveFlash

View GitHub Profile
@skahack
skahack / index.html
Created January 22, 2016 08:37
iOS 9 Safari - workaround
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Viewport Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="/workaround.js"></script>
</head>
<body>
@Craga89
Craga89 / ios-version.js
Created May 29, 2012 16:39
JavaScript iOS version detection
/*
* Outputs a float representing the iOS version if user is using an iOS browser i.e. iPhone, iPad
* Possible values include:
* 3 - v3.0
* 4.0 - v4.0
* 4.14 - v4.1.4
* false - Not iOS
*/
var iOS = parseFloat(
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}