-
Notifications
You must be signed in to change notification settings - Fork 11
feat: add opt-in network logging with fetch, XHR, and WebSocket capture #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…HttpRequest, and WebSocket capture; enhance log filtering by stream tags
@browser-echo/core
@browser-echo/mcp
@browser-echo/next
@browser-echo/nuxt
@browser-echo/react
@browser-echo/vite
@browser-echo/vue
commit: |
…tion\n\n- Core: add networkLogs.bodies options (request/response, maxBytes, allowContentTypes, prettyJson)\n- Core: capture fetch/XHR bodies with content-type allowlist and byte caps\n- Vite: propagate bodies options into virtual client; render snippets\n- Next: expose bodies options in BrowserEchoScript and client code\n- Nuxt: extend module options to include bodies passthrough\n- Discovery: constrain Vite discovery to cwd; fix tests (no default 5179 probe)
…ite, Next, Nuxt, React
…tion\n\n- Introduced a `split` option in `fileLog` to enable separate log files per tag.\n- Updated README with examples for using the new `split` feature in file logging.
…readability\n\n- Updated the `formatSnippet` function to ensure ellipsis is displayed correctly when truncating response bodies.\n- Adjusted the `resSnippet` function to streamline the response handling process.
…cy\n\n- Changed ellipsis from '…' to '...' in log truncation to ensure uniformity in log output.
…ucture\n\n- Replaced the extensive inline variable declarations with a structured payload object for better readability and maintainability.\n- Updated the client module code to initialize the browser echo with a single call, improving clarity and reducing complexity.
…ced a `resolveCoreEntry` function to dynamically resolve the core module path, enhancing flexibility in module loading.\n- Updated client module initialization to use the resolved core entry, improving compatibility with different module formats.
…cture\n\n- Modified the virtual module to call `initBrowserEcho` with a JSON payload, enhancing clarity in the configuration.\n- Updated test assertions to reflect the new payload structure, ensuring accurate validation of the browser echo initialization.
…on across all packages
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR introduces optional network logging capabilities to Browser Echo MCP, allowing developers to capture and monitor network activity alongside console logs.
Changes
New Features:
Implementation Details:
Configuration:
Testing
All existing tests pass with the changes. The implementation maintains backward compatibility while adding new capabilities.
Breaking Changes
None. All changes are additive and opt-in.