iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🗃️

Recovering Zenn Draft Data from LocalStorage

に公開

First draft: 2023-05-04
Hiroyuki Komatsu (@komatsuh)

While I was writing an article on Zenn, I stepped away for a bit. My PC restarted for an automatic update and the browser was forced to close, causing my Zenn draft data to disappear. I guess things like this do happen.

When I tried to reopen the draft page, I got a 404 error.

404 error
Reality is harsh, but the 404 kitty is cute.

However, on Zenn, if the browser is closed normally or in similar situations, you can resume work from draft data saved in LocalStorage. So, in this case as well, I attempted a recovery, hoping that the data remained in LocalStorage.

As a result, I was able to recover it using the following steps:

  1. Open zenn.dev
  2. Open the browser's Developer Tools
  3. Open the Application tab at the top
  4. Select Storage > Local Storage > https://zenn.dev/ on the left
  5. Select autosave-article-XXXX in the Key-Value table in the center
  6. The draft is saved in the Value, so copy the text to recover it

Developer tools

Since I was writing the draft in Chrome, these steps are for Chrome, but I believe similar actions can be taken in most browsers.

While I really should have saved the draft more frequently, I'm grateful that Zenn saves it to LocalStorage.

GitHubで編集を提案

Discussion