Skip to content

Instantly share code, notes, and snippets.

@cdzombak
Created September 17, 2015 18:22
Show Gist options
  • Save cdzombak/3fae303d362747915586 to your computer and use it in GitHub Desktop.
Save cdzombak/3fae303d362747915586 to your computer and use it in GitHub Desktop.
Reenable pinch-to-zoom on obnoxious sites that disable it, like The New Yorker. Convert to a bookmarklet and install via http://mrcoles.com/bookmarklet/ .
var m=document.getElementsByTagName('meta');
for(var i=0; i<m.length; i++) {
if (m[i].name == 'viewport') {
if (m[i].content.indexOf('user-scalable=0') != -1 || m[i].content.indexOf('user-scalable=no') != -1) {
m[i].content = 'width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=4.0, user-scalable=1';
alert('Found & fixed.');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment