FYI, in case anyone was wondering, here's sample code in Java on working with local storage. The sample below uses wrapped code around WebDriver, so you'll have to figure out the pure WebDriver code to call to execute javascript. Easily ported to other language bindings.
public void removeItemFromLocalStorage(String item){
this.executeJavascript(String.format("window.localStorage.removeItem('%s');", item));
}
public boolean isItemPresentInLocalStorage(String item){
if(this.executeJavascript(String.format("return window.localStorage.getItem('%s');", item)) == null)
return false;
else
return true;
}
public String getItemFromLocalStorage(String item){
return (String) this.executeJavascript(String.format("return window.localStorage.getItem('%s');", item));
}
public void setItemInLocalStorage(String item, String value){
this.executeJavascript(String.format("window.localStorage.setItem('%s','%s');", item, value));
}
public void clearLocalStorage(){
this.executeJavascript(String.format("window.localStorage.clear();"));
}
should work across most browsers per the link I mentioned earlier. Unless you're working with old browsers.