I want to export a few items from my localStorage to save it externally but in a format so that I can import it again later.
My attempt was to write executable code that
Just an improved version of Jeremy. To simplify the process
copy('var data = '+JSON.stringify(localStorage)+';Object.keys(data).forEach(function (k){localStorage.setItem(k, data[k]);});');
Run this in console where you need to export, it copies localstorage content along with code to clipboard and just paste it in the console where you want to import.