Conversation
…, and correct manifest structure
… flow - Prevented repeated loading of zero-shot and embedding models in transformers.js - Added performance timers and debug logs for model loading - Enabled optional `useFake` flag for offline embedding fallback - Ensured getEmbedding only loads once and is reused across pipeline - Improved background.js init: loads model first, then batches - Refactored StorageManager.js to handle batching with skipEmbedding option - Cleaned up duplicate history handling and CSV updates - Proper third-party and about:blank domain filtering - Models now load once and stay cached across batch operations
- Blocked subdomain-based tracking (e.g., tr.snapchat.com) - Improved logging and CSV protection - Ensured clean IndexedDB and historyData tracking only real user visits - Added analytics.js for tracking user interactions and will host exstension logic
* added prompts * Correct filename casing to resolve import issues on case-sensitive systems * fixed prompt function, took out refernece to nonexisting asset, moved fetch history to front end * putting info from background onto slides * got it to not repeat domains * all slide info in one file * rest of handler slides * fix time range, add in prompts, fix time spent and peak browsing time * Styling * more style * top sites now shows up, still shows up if less than 3 sites * added setting button, will add setting pg content later * more prompts to match background handlers ! changed function that grabs prompt --------- Co-authored-by: tshasan <taimurhasan@proton.me> Co-authored-by: divaldez7464 <divaldez7464@users.noreply.github.com> Co-authored-by: katesawtell <katesawtell@users.noreply.github.com>
Fix/develop2
- Added JSDoc comments to various modules and functions for better clarity and maintainability. - Introduced new scripts in package.json for generating and serving documentation. - Updated background script to expose handler functions for easier debugging. - Refactored database initialization and storage functions to improve error handling and logging. - Enhanced concurrency handling in utility functions based on environment capabilities. - Updated configuration constants for better clarity and added new constants for ML engine configuration. - Improved the logic for counting co-occurrences and trends in browsing history. - Added new functions for fetching unique websites and visit counts per hour. - Cleaned up and organized handler exports for better module management.
Enhance documentation and improve code structure
There was a problem hiding this comment.
Pull Request Overview
This PR rewrites and refactors the background handler functions and related configuration for the Firefox Recap extension, enhancing data processing and updating documentation and CI workflows.
- Refactored module handler exports and individual functionality for visit and domain analysis
- Updated CI workflow and ESLint configuration, and refreshed the README documentation
- Removed unused models/transformers.js file
Reviewed Changes
Copilot reviewed 77 out of 81 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/background/handlers/index.js | Re‑exports all background handler functions |
| src/background/handlers/*.js (multiple files) | Implements data aggregation for visits, unique websites, trends, etc. |
| src/background/handlers/fetchAndStoreHistory.js | Fetches history, applies ML classification, and stores data atomically |
| src/background/background.js | Initializes database and exposes handler functions globally |
| eslint.config.mjs | Updates ESLint config to include Node globals and updated settings |
| README.md | Revamps extension documentation and usage instructions |
| .github/workflows/ci.yml | Updates CI pipeline with Node v18 and revised build/test steps |
Files not reviewed (4)
- .babelrc: Language not supported
- jsdoc.json: Language not supported
- manifest.json: Language not supported
- package.json: Language not supported
Comments suppressed due to low confidence (1)
src/background/handlers/fetchAndStoreHistory.js:42
- [nitpick] The variable 'i' is not descriptive; consider renaming it to 'historyItem' for improved readability.
for (const i of raw) {
| for (const i of raw) { | ||
| if (!(await shouldBlockDomain(i.url))) valid.push(i); | ||
| } | ||
| if (!valid.length) return console.debug('No valid history items found.'); |
There was a problem hiding this comment.
Consider returning 0 instead of just logging a debug message when no valid history items are found, so that the function consistently returns a number as promised.
Suggested change
| if (!valid.length) return console.debug('No valid history items found.'); | |
| if (!valid.length) { | |
| console.debug('No valid history items found.'); | |
| return 0; | |
| } |
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
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.
Rewrite