Skip to content

1.1.4

Choose a tag to compare

@sebastienfontaine sebastienfontaine released this 12 Nov 11:38
· 16 commits to master since this release
a46cdca

πŸ› Critical Bug Fixes

Fixed SPA freeze issue (GitHub, Gmail, etc.)

  • Problem: Extension caused Chrome to freeze when navigating on Single Page Applications
  • Symptoms:
    • Network requests hanging ("pending")
    • Memory usage growing to GBs
    • Page completely frozen
    • Browser unresponsive
  • Root cause:
    • UrlChangeDetector was observing entire document with aggressive throttling
    • MutationObserver firing thousands of times during DOM changes
  • Fix:
    • Changed from throttling to debouncing (500ms wait after last mutation)
    • Reduced observation scope to only <title> element instead of entire document
    • Prevents callbacks during heavy DOM manipulation
  • Impact: ~99% reduction in observer callbacks β†’ massive performance improvement
  • Files changed:
    • src/content/UrlChangeDetector.ts
    • src/content/RuleApplicationService.ts

Fixed "unique tab" closing wrong tabs

  • Problem: Unique feature was closing unrelated tabs (e.g., Gmail when refreshing GitHub)
  • Root cause:
    • When url_fragment doesn't contain $1 placeholder, _processUrlFragment() returns same value for all URLs
    • This made all tabs appear as duplicates
  • Example scenario:
    • Rule: url_fragment: "github.com/issues", url_matcher: "github\.com/.+/issues/(\d+)"
    • GitHub tab: processed to "github.com/issues"
    • Gmail tab: also processed to "github.com/issues" (no match, returns fragment as-is)
    • Both equal β†’ Gmail closed! ❌
  • Fix:
    • Added validation: tabs must match url_matcher pattern before comparison
    • Without url_matcher: compare exact URLs only
    • Prevents closing tabs that don't match the rule's pattern
  • Impact: Unique feature now works correctly, no more random tab closures
  • Files changed: src/background/TabRulesService.ts
  • Tests added: src/background/__tests__/TabRulesService.unique.test.ts (85 new test cases)

✨ New Features

Rule copy/paste functionality

  • Feature: Copy rules to clipboard and paste them to duplicate
  • How to use:
    • Click copy icon next to a rule β†’ copies to clipboard
    • Click "Paste rule" button β†’ creates new rule from clipboard
  • Use case: Quickly duplicate rules with slight modifications
  • Feature flag: Can be disabled via FEATURE_FLAGS.ENABLE_RULE_COPY_PASTE
  • Files changed:
    • src/Options.vue
    • src/stores/rules.store.ts
    • src/components/options/center/sections/TabRules/TableRules.vue
  • Files added: src/components/icons/ClipboardIcon.vue

Paste rule: Auto-refresh

  • Problem: After pasting a rule, the list didn't refresh to show the new rule
  • Fix: Store automatically refreshes after paste operation
  • Files changed: src/Options.vue

πŸ”§ Technical Improvements

Feature flags system

  • Added: src/common/feature-flags.ts for toggling experimental features
  • Current flags:
    • ENABLE_RULE_COPY_PASTE: Enable/disable copy/paste functionality

URL change detection optimization

  • Before: Throttled MutationObserver checking every 100ms during mutations
  • After: Debounced observer waiting 500ms after mutations settle
  • Result: Only checks URL after DOM changes complete, not during

Observer lifecycle management

  • Properly disconnect observers before creating new ones
  • Prevents memory leaks from accumulated observers
  • Better performance on long-running tabs

πŸ§ͺ Tests

Comprehensive unique tab test suite

  • 85+ new test cases covering all unique tab scenarios
  • Tests for GitHub-style URLs with issue numbers
  • Tests for simple CONTAINS detection without url_matcher
  • Edge cases: nested duplicates, different issue numbers, etc.
  • Files added: src/background/__tests__/TabRulesService.unique.test.ts

🎯 User Impact

For users experiencing Chrome freezing:

  • βœ… FIXED: GitHub navigation no longer freezes
  • βœ… FIXED: Gmail and other SPAs work smoothly
  • βœ… FIXED: Network requests complete normally
  • βœ… FIXED: Memory usage stays stable (no more GB growth)

For users experiencing unique tab issues:

  • βœ… FIXED: Unique feature no longer closes random tabs
  • βœ… FIXED: Gmail won't close when refreshing GitHub
  • βœ… FIXED: Only true duplicates are closed

For users wanting to duplicate rules:

  • βœ… NEW: Copy/paste rules for quick duplication

πŸ“Š Performance Metrics

  • Observer callbacks: ~99% reduction on SPAs (thousands β†’ ~10 per navigation)
  • Memory usage: Stable (prevents GB-scale growth)
  • CPU usage: Dramatically reduced during SPA navigation
  • Debounce delay: 500ms after DOM changes settle
  • Test coverage: 218 tests passing

πŸ”„ Migration Notes

No migration needed. All changes are backward compatible.

For users with unique tab rules:

If you were experiencing tabs closing incorrectly, this should now work as expected.

For REGEX users:

Patterns with nested quantifiers (e.g., (?:[\w-]+\.)*) are blocked for security.
Use simplified patterns instead: google\.com/.*/u/5/

⚠️ Known Issues

None reported. All critical bugs from 1.1.3 have been resolved.