I have a switch that I'd like to turn on and off in my browser's localStorage
using a bookmarklet.
What would be a good bookmarklet for toggling the value of a hard-coded key between "0" and "1"?
I have a switch that I'd like to turn on and off in my browser's localStorage
using a bookmarklet.
What would be a good bookmarklet for toggling the value of a hard-coded key between "0" and "1"?
javascript:(function(){localStorage["key"]=(localStorage["key"]=="1"?"0":"1")})()
Note that the bookmarklet must be run while the browser is on a page in the domain that owns the localStorage value that you'd like to toggle.