Add a setting to turn off auto-lock #14

Merged
backmeupplz merged 1 commit from feat/autolock-setting into main 2026-10-04 01:27:16 +00:00
backmeupplz commented 2026-10-04 01:18:52 +00:00 (Migrated from github.com)

Adds Settings → Lock after 15 minutes without use, on by default.

  • Storage. "Off" is stored in storage.local as a MAC under the vault key. A website's process (Firefox content process) can delete it, which only turns auto-lock back on, but it can't forge "off". When the wallet is locked, there's nothing to check the MAC against, so auto-lock counts as on.
  • Still locks. With auto-lock off, the wallet still locks on browser restart (the key is in storage.session) and with the Lock button.
  • touch() arms the 15-minute alarm only when auto-lock is on, and clears it otherwise.
  • Android hides the switch, because the app locks itself when you leave it.

Checks

  • npm test passes. test-reset.js covers: turning auto-lock off clears the alarm, the setting survives lock/unlock, a forged value keeps auto-lock on, the wallet reads as on while locked, and turning it back on re-arms the alarm.
  • The owner tested it in LibreWolf with a local build.

🤖 Generated with Claude Code

Adds **Settings → Lock after 15 minutes without use**, on by default. - **Storage.** "Off" is stored in `storage.local` as a MAC under the vault key. A website's process (Firefox content process) can delete it, which only turns auto-lock back on, but it can't forge "off". When the wallet is locked, there's nothing to check the MAC against, so auto-lock counts as on. - **Still locks.** With auto-lock off, the wallet still locks on browser restart (the key is in `storage.session`) and with the Lock button. - **`touch()`** arms the 15-minute alarm only when auto-lock is on, and clears it otherwise. - **Android** hides the switch, because the app locks itself when you leave it. ## Checks - `npm test` passes. `test-reset.js` covers: turning auto-lock off clears the alarm, the setting survives lock/unlock, a forged value keeps auto-lock on, the wallet reads as on while locked, and turning it back on re-arms the alarm. - The owner tested it in LibreWolf with a local build. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.