feat: Support reading all tabs content instead of only active tab #755
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
Extended the Chrome extension's page content reading capability from supporting only the active tab to reading all tabs in the current browser window, enabling the AI assistant to answer questions about any open tab.
🔧 Changes
Modified Files
src/popup.ts- Refactored thefetchPageContents()functionCore Improvements
Expanded Query Scope
chrome.tabs.query({ currentWindow: true, active: true })To
chrome.tabs.query({ currentWindow: true })Parallel Multi-tab Processing
forEachto iterate through all tabscompletedTabsto track processing progressStructured Data Storage
Formatted Output
=== Tab X: Title ===\nURL: xxx\n\nContent\n\nEnhanced Error Handling
try-catchblocks to handle connection failuresonDisconnectlisteners to handle inaccessible pages (e.g.,chrome://pages)Updated System Prompt
chrome://,edge://) cannot be injected with content scripts and will be automatically skipped