Created
October 23, 2011 16:40
-
-
Save BlairDuncan/1307562 to your computer and use it in GitHub Desktop.
This file contains 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
@implementation CPUserDefaultsLocalStore(FixForPrivateBrowsingExceptionError) | |
- (void)setData:(CPData)aData | |
{ | |
// wrapping in a try/catch so as to not send a DOM Exception error when Private Browsing is enabled | |
try | |
{ | |
localStorage.setItem(_domain, encodeURIComponent([aData rawString])); | |
} | |
catch (e) | |
{ | |
// unable to write to localStorage | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment