Store history in localStorage for the extension