Files
P4RS3LT0NGV3/js/tools
Claude afe00b3534 Fix OpenRouter API key not working for translation and improve error handling
- API key retrieval now trims whitespace (pasted keys with spaces caused auth failures)
- Fallback to Vue data property if localStorage is empty (covers forgot-to-save case)
- Auto-saves key to localStorage when found only in Vue data
- HTTP-level error handling (401/402/403) with clear user-facing messages
- Changed HTTP-Referer from window.location.origin to window.location.href
  (origin returns "null" for file:// URLs, breaking OpenRouter requests)
- Handle non-JSON error responses gracefully
- Handle string-type error responses from OpenRouter
- Added missing else branch for empty API responses
- Updated README with AI Translation, PromptCraft, and OpenRouter key setup docs

https://claude.ai/code/session_01DjqbQB8WcZoGVe78sjvh72
2026-03-21 02:11:28 +00:00
..