Last active
August 29, 2015 14:17
-
-
Save AllThingsSmitty/4ee72642c88c11695ec6 to your computer and use it in GitHub Desktop.
Feature detection for proxy browsers that lie about their capabilities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// localStorage example | |
var hasStorage = (function () { | |
try { | |
localStorage.setItem(mod, mod); | |
localStorage.removeItem(mod); | |
return true; | |
} catch (exception) { | |
return false; | |
} | |
}()); | |
// Streamlined cut-the-mustard method using Page Visibility API (http://caniuse.com/#feat=pagevisibility) | |
if ('visibilityState' in document) { | |
// Modern browser, add JS functionality | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Additional context about this.