Benjol / SE-AutoReviewComments

AutoReviewComments - Pro-forma comments for SE
http://stackapps.com/q/2116
98 stars 39 forks source link

Migrate comments from HTTP to HTTPS #134

Open barmar opened 7 years ago

barmar commented 7 years ago

SE has switched all their sites from HTTP to HTTPS (https://stackoverflow.blog/2017/05/22/stack-overflow-flipped-switch-https/?cb=1). None of my saved comments are showing up now. It would be great if you could provide a way to copy all the comments over, or make the URL matching independent of this distinction.

Or just tell me where the comments are saved, I could probably update it by hand easily.

Benjol commented 7 years ago

Thanks for the heads-up!

I'm not sure that there's a way to do this automagically. It's cross-domain security stuff.

The comments are stored in localStorage, which you can access via the Developer plugin in Firefox (you have to edit the settings in the Developer plugin to show the Storage tab). BUT that doesn't help, because as far as I can tell, you can't see storage data for anything other than the current URL, and given that you can't navigate to the old URL...

So, this is the workaround that I've tested for Firefox (suggestions are welcome for other browsers). With apologies to non-technical people, as it's a bit heavy-going:

barmar commented 7 years ago

I'm using Chrome on OS X. https://superuser.com/questions/507536/where-does-google-chrome-save-localstorage-from-extensions explains where it stores local storage, I'll try to find this.

barmar commented 7 years ago

Chrome stores local storage in ~/Library/Application Support/Google/Chrome/Default/Local Storage/. Each domain has two files:

http_stackoverflow.com_0.localstorage http_stackoverflow.com_0.localstorage-journal

I renamed all these to https_XXX, and now I've got my auto-comments back!

Benjol commented 7 years ago

@barmar, yes that's what I figured too, I'm not sure what the -journal file is. Try it and let us know!