LocalStorage Backup

Back up website localStorage to Google Drive. Chrome extension + mobile bookmarklet.

View the Project on GitHub hpp3/localstorage-backup

LocalStorage Backup

Back up and restore any website’s localStorage to your own Google Drive. Ships as a Chrome extension (background auto-backup on a schedule) and a mobile bookmarklet (manual + catchup-on-tap).

Primary use case: preserving save data from browser-based idle/incremental games like Cookie Clicker, Universal Paperclips, A Dark Room.

Components

Develop

npm install
npm run build         # builds extension + bookmarklet into dist/
npm run watch         # rebuild on save
npm run typecheck     # tsc --noEmit

Loading the extension locally: chrome://extensions → enable Developer mode → “Load unpacked” → select dist/.

Local bookmarklet testing:

cd dist/bookmarklet && npx serve -p 3000

Set AUTH_URL in src/bookmarklet/config.ts to http://localhost:3000/auth.html, rebuild, visit http://localhost:3000/, drag the install link to your bookmarks bar.

Google Cloud setup

Two separate OAuth clients — one per surface.

Extension (Chrome extension OAuth client)

  1. Google Cloud Console → APIs & Services → Credentials → Create credentials → OAuth client ID → Application type: Chrome extension.
  2. Paste the extension ID. For unpacked dev, this is shown in chrome://extensions after loading.
  3. Copy client ID into src/extension/manifest.json under oauth2.client_id.
  4. Rebuild + reload.

Chicken-and-egg for CWS submission: the Chrome extension OAuth client is bound to a specific extension ID. Your unpacked local dev ID is different from the stable ID CWS assigns on upload. Two ways to handle this:

Bookmarklet (Web application OAuth client)

  1. Credentials → Create credentials → OAuth client ID → Application type: Web application.
  2. Authorized JavaScript origins: wherever you host auth.html (e.g. https://hpp3.github.io, http://localhost:3000).
  3. No redirect URIs needed (GIS token flow).
  4. Copy client ID into src/bookmarklet/config.ts.

Chrome Web Store submission checklist

  1. npm run build, verify dist/ loads cleanly as an unpacked extension.
  2. Zip dist/ contents: cd dist && zip -r ../localstorage-backup.zip .
  3. Register a Chrome Web Store developer account ($5 one-time fee).
  4. Create a new item, upload localstorage-backup.zip.
  5. Fill in the store listing using copy from STORE.md. Privacy policy URL: https://hpp3.github.io/localstorage-backup/PRIVACY.
  6. Upload 1–5 screenshots (1280×800 or 640×400) showing the popup in action.
  7. Paste permission justifications from STORE.md.
  8. Submit for review. Non-sensitive scopes typically clear in 1–5 business days.
  9. After approval: the CWS-assigned extension ID becomes stable. Verify the OAuth client is tied to this ID.

Architecture notes

License

MIT — see LICENSE.