Issue: postMessage Tracker Includes Events from Other Extensions #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
The postMessage-tracker Chrome extension currently logs postMessage events originating not only from the web application being inspected but also from other installed Chrome extensions (e.g., Wappalyzer). This leads to the inclusion of irrelevant messages in the tracked data, making it harder to focus on the application-specific communication.
For example, messages with stack traces like at chrome-extension://gppongmhjkpfnbhagpmjfkannfbllamg/js/js.js:48:5 were being captured.
Solution:
To address this, the content_script.js has been modified to filter out postMessage events that originate from any Chrome extension.
The filtering logic was implemented in the l function within content_script.js. This function is responsible for processing and logging the postMessage listeners. The modification involves inspecting the stack trace associated with each listener. If the stack trace string contains chrome-extension://, indicating that the message originated from an extension, the listener is ignored and not processed further.
Specifically, the following check was added:
Apply to content_scri...
This change ensures that only postMessage events from the web page itself (and not other extensions) are tracked, providing a cleaner and more focused debugging experience.