*Please, keep this on topic. There's no point to rehashing http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-April/019238.htmlor any of the other similar debates on private browsing and localStorage's persistence guarantees.*
When in "private browsing" mode, WebKit should not write any data to the hard drive. In addition, WebKit does not allow changes to localStorage that aren't going to be written to disk. Currently, it returns a DOM_QUOTA_ERROR on setItem when private browsing is enabled, and silently fails for removeItem and clear. The silent failures are obviously bad, but even the (ab)use of DOM_QUOTA_ERROR kind of bothers me. Is there an exciting exception that'd work better to tell the script "the change failed because localStorage is currently immutable"? If not, is there any chance it could be added to the spec? Obviously only browser vendors that share WebKit's philosophy on localStorage's "guarantee" of persistence would actually use this, but I think it'd be far better than the current behavior. Thanks, Jeremy