mikailustuner/omnirule/browser-apis

Claude Code and agent skill by mikailustuner/omnirule

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Browser APIs: Storage, IndexedDB, BroadcastChannel, SharedWorker, Clipboard

Install

npx vskill@latest install mikailustuner/omnirule/browser-apis

SKILL.md

The same SKILL.md was published earlier as mikailustuner/omnirule/browser-apis.

Browser APIs Patterns

Focus: Client-side storage, cross-tab communication, background processing

1. Storage Decision Tree

Use localStorage when:
├── Simple key-value pairs
├── String data only
├── Under 5MB
└── Synchronous access OK
Use sessionStorage when:
├── Tab-specific data
├── Auto-clear on tab close
└── Sensitive data (per tab)
Use IndexedDB when:
├── Large structured data
├── Complex queries needed
├── Binary data (blobs)
└── Transaction support needed
Use Cache API when:
├── HTTP response caching
├── Offline support
└── Network-first/fallback

2. IndexedDB Patterns

Schema design:
├── Object stores: like tables
├── Indexes: for query performance
└── Version increment: for migrations
Transaction modes:
├── Read-only: safe, concurrent
├── Read-write: single writer
└── Version change: schema changes
Async patterns:
├── Promises (modern)
├── Event-based (legacy)
└── Cursor for large datasets
Common mistakes:
├── Not handling version upgrades
├── Transaction too long
└── Storing non-serializable

3. BroadcastChannel Patterns

Use case: Cross-tab sync
├── Same-origin tabs only
├── Real-time communication
└── No server needed
Implementation:
├── Create: new BroadcastChannel('name')
├── Send: channel.postMessage(data)
└── Receive: channel.onmessage
Use patterns:
├── Login state sync
├── Theme changes
├── Cache invalidation
└── Form state sharing
Limits:
├── 1MB message size
├── Not supported in all browsers
└── Safari: limited support

4. SharedWorker Patterns

Use case:
├── Shared state across tabs
├── Background processing
└── Single connection management
Communication:
├── Port-based messaging
├── MessageChannel for direct comm
└── Shared state via IndexedDB
Lifecycle:
├── Created on first connection
├── Stays alive while any tab connected
└── Dies when last tab closes
Warning:
├── Debugging is hard
├── Memory leaks possible
└── Browser support varies

5. Clipboard API Patterns

Read (paste):
├── Requires permission (navigator.permissions)
├── Support varies by browser
└── Handle plain text and HTML
Write (copy):
├── navigator.clipboard.writeText()
├── Modern: write() with ClipboardItem
├── Fallback: execCommand (deprecated)
Security:
├── User gesture required
├── Permission prompts
└── Don't trust clipboard content
Pattern:
├── Try modern API first
├── Handle errors gracefully
└── Provide fallback UI

6. Storage Limits & Quotas

localStorage:
├── 5-10MB per origin
├── Synchronous, blocking
└── No transactions
sessionStorage:
├── Same limit as localStorage
├── Per-tab isolation
└── Cleared on close
IndexedDB:
├── Variable: 50MB+
├── User can increase
└── Async, non-blocking
Cache API:
├── No fixed limit
├── Browser-managed eviction
└── Per-origin quota

Key Patterns

  1. IndexedDB for complexity - Queries, large data
  2. localStorage for simple - Quick, synchronous
  3. BroadcastChannel - Cross-tab sync, no server
  4. SharedWorker - Shared background processing
  5. Clipboard requires gesture - Don't rely on read
  6. Always handle quota errors - Storage limited

Anti-Patterns

❌ IntersectionObserver not disconnected after element removed
✅ observer.disconnect() in cleanup / useEffect return
❌ Blocking main thread with synchronous XHR
✅ Always async: fetch() with await
❌ Storing sensitive data in localStorage (XSS accessible)
✅ Sensitive data in HttpOnly cookies; localStorage only for non-sensitive
❌ Registering event listeners without removing on unmount
✅ Return cleanup function in useEffect; removeEventListener
❌ navigator.geolocation without feature detect
✅ Always feature-detect: if ('geolocation' in navigator)

Quick Reference

APIUse caseMDN
IntersectionObserverLazy load, scroll triggerobserve/unobserve
ResizeObserverResponsive componentsobserve element
MutationObserverWatch DOM changesobserve with config
Web WorkersOff-thread computationpostMessage
IndexedDBLarge client storagevia idb library
Web CryptoClient-side cryptosubtle.digest, encrypt

🌍 Universal Language Support

  • Turkish Native: This skill natively supports Turkish. If the user prompt is in Turkish, all analysis, formatting, and output MUST be entirely in Turkish. You do not need explicit "write in Turkish" instructions.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
5
Repository forks
3
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mikailustuner/omnirule/browser-apis/badge)](https://verified-skill.com/skills/mikailustuner/omnirule/browser-apis)

Something wrong with this skill or its page? Tell us.