localStorage-patterns
This skill provides a comprehensive guide to localStorage patterns for building resilient web applications with client-side persistence.
Install this skill
Security score
The localStorage-patterns skill was audited on Feb 28, 2026 and we found 34 security issues across 3 threat categories. Review the findings below before installing.
Categories Tested
Security Issues
Template literal with variable interpolation in command context
| 191 | console.log(`Usando ${usedMB} MB de ${quotaMB} MB (${(estimate.usage / estimate.quota * 100).toFixed(1)}%)`); |
Template literal with variable interpolation in command context
| 200 | console.log(`- ${key}: ${(size / 1024).toFixed(2)} KB`); |
Template literal with variable interpolation in command context
| 364 | const key = `plataforma-b2b_notes_${courseId}`; |
Template literal with variable interpolation in command context
| 370 | console.error(`Erro ao salvar notas (${key}):`, error); |
Template literal with variable interpolation in command context
| 385 | localStorage.setItem(`plataforma-b2b_notes_${courseId}`, notes); // Pode crashar! |
Template literal with variable interpolation in command context
| 406 | const saved = localStorage.getItem(`plataforma-b2b_notes_${courseId}`); |
Template literal with variable interpolation in command context
| 422 | localStorage.setItem(`plataforma-b2b_notes_${courseId}`, notes); |
Template literal with variable interpolation in command context
| 430 | sessionStorage.setItem(`plataforma-b2b_notes_${courseId}_temp`, notes); |
Template literal with variable interpolation in command context
| 512 | console.log(`Usando ${info.usedMB} MB de ${info.quotaMB} MB (${info.percentUsed}%)`); |
Template literal with variable interpolation in command context
| 536 | message: `Nota muito grande (${sizeKB} KB). Limite: 50 KB.` |
Template literal with variable interpolation in command context
| 600 | console.log(`Removido: ${key} (${ageInDays.toFixed(0)} dias)`); |
Template literal with variable interpolation in command context
| 604 | console.warn(`Erro ao processar ${key}:`, error); |
Template literal with variable interpolation in command context
| 609 | console.log(`Liberados ${freedKB} KB de armazenamento`); |
Template literal with variable interpolation in command context
| 666 | console.log(`Migrado ${key} para v2`); |
Template literal with variable interpolation in command context
| 672 | console.error(`Erro ao migrar ${key}:`, error); |
Template literal with variable interpolation in command context
| 707 | return `plataforma-b2b_${type}_${identifier}`; |
Template literal with variable interpolation in command context
| 739 | this.key = `plataforma-b2b_progress_${courseId}`; |
Template literal with variable interpolation in command context
| 929 | const key = `plataforma-b2b_notes_${courseId}`; |
Template literal with variable interpolation in command context
| 967 | console.warn(`Nota muito grande: ${(sizeBytes / 1024).toFixed(2)} KB`); |
Template literal with variable interpolation in command context
| 994 | sessionStorage.setItem(`${key}_temp`, notes); |
Template literal with variable interpolation in command context
| 1038 | const key = `plataforma-b2b_progress_${courseId}`; |
Template literal with variable interpolation in command context
| 1056 | console.log(`Módulo ${moduleId} já completo`); |
Template literal with variable interpolation in command context
| 1189 | localStorage.setItem(`item_${i}`, data[i]); |
Template literal with variable interpolation in command context
| 1295 | console.log(`Total usado: ${calculateTotalSize()} MB`); |
Template literal with variable interpolation in command context
| 1310 | console.log(`Removido: ${key}`); |
Template literal with variable interpolation in command context
| 1346 | console.log(`✅ ${key} válido`); |
Template literal with variable interpolation in command context
| 1348 | console.error(`❌ ${key} corrompido:`, error); |
Template literal with variable interpolation in command context
| 1364 | console.error(`Erro ao parsear ${key}:`, error); |
Template literal with variable interpolation in command context
| 1402 | notes: (courseId) => `plataforma-b2b_notes_${courseId}`, |
Template literal with variable interpolation in command context
| 1403 | progress: (courseId) => `plataforma-b2b_progress_${courseId}` |
Template literal with variable interpolation in command context
| 1437 | console.log(`Escritas/segundo: ${writeCount}`); |
Fetch to external URL
| 1174 | await fetch('/api/auth/login', { |
External URL reference
| 1488 | - **[Can I Use - localStorage](https://caniuse.com/namevalue-storage)** - Suporte por browser |
External URL reference
| 1489 | - **[Web.dev - Storage Limits](https://web.dev/storage-for-the-web/)** - Limites detalhados |