Please help me in this what I am trying to do is I have
I am trying to run this HTML5 application in cocoa application and get this error "Error: Unknown error Error: SECURITY_ERR: DOM Exception 18." same application is working fine in
I have tried following things
@interface WebPreferences (WebPreferencesPrivate)
- (void) _setLocalStorageDatabasePath:(NSString *)path;
- (void) setDatabasesEnabled: (BOOL) databaseEnabled;
- (void) setLocalStorageEnabled: (BOOL) localStorageEnabled;
@end
WebPreferences* prefs = [self.mainWebVEW preferences];
[prefs _setLocalStorageDatabasePath:appdir];
[prefs setDatabasesEnabled:YES];
[prefs setLocalStorageEnabled:YES];
[prefs setDefaultFontSize:20];
only preference that seem working is font size.
Can anybody help me how to get over this?
Thanks in advance
Regards
Ankit
ok so finally resolved it all you have to do is use one more private API
@interface WebView(WebViewPrivate)
- (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(id) origin database:(NSString *)databaseIdentifier;
@end
- (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(id) origin database:(NSString *)databaseIdentifier
{
static const unsigned long long defaultQuota = 5 * 1024 * 1024;
if ([origin respondsToSelector: @selector(setQuota:)]) {
[origin performSelector:@selector(setQuota:) withObject:[NSNumber numberWithLongLong: defaultQuota]];
} else {
NSLog(@"could not increase quota for %@", defaultQuota);
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.