From what I have seen, if you are building a OSX desktop HTML5 app and want localStorage to persist in your WebView wrapper, you need to do something like this:
I have found a solution to the persistence problem. see my post at
Local Storage in webview is not persistent