osx - Cocoa: WKWebView local storage -


i trying local storage working wkwebview.

i have created small demo project. mac app shows window buttons , wkwebview.

the 3 buttons show 3 variations of same page: sticky notes webkit demo:

the first 2 not work; latter does.

what should happen should appear 1 default sticky note, , enabled new note button add new sticky notes.

in remote , local variations, no note appears, , new note button disabled, indicating couldn't access local storage.

i'm hoping i'm doing wrong in loading wkwebview, it's possible isn't supported.

here's code remote variation:

wkwebviewconfiguration *config = [wkwebviewconfiguration new];  config.websitedatastore = [wkwebsitedatastore defaultdatastore];  self.webview = [[wkwebview alloc] initwithframe:self.container.frame configuration:config]; self.webview.autoresizingmask = nsviewwidthsizable | nsviewheightsizable;  [self.container addsubview:self.webview];  nsurl *url = [nsurl urlwithstring:@"https://webkit.org/demos/sticky-notes/"]; nsurlrequest *request = [nsurlrequest requestwithurl:url];  [self.webview loadrequest:request]; 

any assistance appreciated!

update: turned out while local storage mechanism using work in safari , not wkwebview, easier expected: use localstorage javascript variable.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -