Skip to content

Instantly share code, notes, and snippets.

@pawel-dubiel
Created September 13, 2012 11:48
Show Gist options
  • Save pawel-dubiel/3713813 to your computer and use it in GitHub Desktop.
Save pawel-dubiel/3713813 to your computer and use it in GitHub Desktop.
#Iphone check the Private browsing is enabled
try {
localStorage.setItem('test', 'test');
} catch (err) {
if ((err.name).toUpperCase() == 'QUOTA_EXCEEDED_ERR') {
document.write('<div style="padding:5%;margin:5%;background:#777;color:white;height:90%">We don\'t seem to be able to store the information needed for this app to work on your phone.<br /><br /> It\'s probably because you have enabled private browsing mode. If you\'d like to disable private browsing go to settings section on your phone.</div>');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment