Scope
Purpose
Configuration
pwa:
manifest:
enabled: true
scope: "/" # Controls all URLs under your domainHow Scope Works
URLs Within Scope
Relationship with start_url
Common Scope Patterns
Pattern 1: Root Scope (Most Common)
Pattern 2: Application Subfolder
Pattern 3: Versioned Scope
Pattern 4: Language-Specific Scope
Practical Examples
Example 1: E-commerce Site
Example 2: SaaS Dashboard
Example 3: Multi-tenant Application
Example 4: Full-Site PWA
Advanced Configurations
Multiple Manifests for Different Scopes
Dynamic Scope Based on User
Scope and Service Workers
Testing Your Scope
1. Check Manifest in DevTools
2. Test Navigation Behavior
3. Test with Different URLs
Common Mistakes
1. start_url Outside Scope
2. Too Restrictive Scope
3. Forgetting Trailing Slash
4. Mismatched Service Worker Scope
Scope Validation Errors
Error: start_url not within scope
Error: Invalid scope format
Platform-Specific Behavior
iOS/Safari
Android/Chrome
Desktop Browsers
Best Practices
1. Start Broad, Refine Later
2. Align with Site Architecture
3. Consider Future Growth
4. Document Your Scope Decision
5. Test Across Platforms
Debugging Scope Issues
Check Current Scope
Monitor Navigation Events
Validate scope Configuration
Related Properties
Summary
Last updated
Was this helpful?