Skip to content

Conversation

addshoppers-jg
Copy link

Summary

  • Adds setIgnoreNamespaces() and getIgnoreNamespaces() functions for global message filtering
  • Messages with namespaces matching any prefix in the ignore list are filtered out globally
  • Applies to all messaging instances across background and content scripts
  • Includes comprehensive test coverage and API documentation

This feature allows applications to ignore messages from external libraries or browser extensions that may interfere with application messaging by specifying namespace prefixes to filter out globally.

Usage

import { setIgnoreNamespaces } from '@webext-core/messaging';

// Call this in both background.js and content scripts
setIgnoreNamespaces(['external-sdk:', 'analytics:', 'tracking:']);

Test Plan

  • Unit tests added for global namespace filtering functionality
  • Tests verify messages with ignored namespaces are filtered out
  • Tests verify messages without ignored namespaces are processed normally
  • Tests verify namespace management functions work correctly
  • All existing tests continue to pass
  • API documentation updated with usage examples

- Add setIgnoreNamespaces() and getIgnoreNamespaces() functions for global message filtering
- Messages with namespaces matching any prefix in the ignore list are filtered out
- Applies to all messaging instances globally
- Add comprehensive test coverage for the functionality
- Add optional namespace field to Message interface
- Document setIgnoreNamespaces() and getIgnoreNamespaces() functions
- Include usage example for global namespace filtering
- Clarify that setIgnoreNamespaces should be called in both background and content scripts
…ation

- Add optional namespace field to Message interface in API docs
- Include property description for external library message identification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants