javascript:(function(){localStorage["key"]=(localStorage["key"]=="1"?"0":"1")})()
Please note that the bookmarklet should be launched while the browser is on the page in the domain to which the localStorage value that you want to switch belongs.
source share