-
Notifications
You must be signed in to change notification settings - Fork 28
Automatically block & unblock tabs #115
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
base: master
Are you sure you want to change the base?
Conversation
Previously, when having the Popup open while a timer expired, the UI did not update accordingly, but wrapped back to displaying a 1 hour timer on the cancel button This commit fixes this bug revert pausebutton for dev purposes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements automatic tab blocking/unblocking functionality when the Impulse Blocker extension is toggled on/off or paused. It also addresses Firefox CSP requirements by statically importing CSS files and updates several NPM dependencies.
Key Changes:
- Adds
refreshBlockedTabs()to automatically reload tabs with blocked domains when the blocker starts - Adds
enableBlockedTabs()to automatically restore blocked tabs to their original URLs when the blocker is paused or stopped - Fixes countdown timer in PauseSection to properly trigger state refresh when pause expires
- Migrates CSS imports from JavaScript to static HTML link tags for Firefox CSP compliance
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ImpulseBlocker.js | Core functionality: adds tab refresh/enable methods and integrates them with start/stop/pause workflows |
| src/popup/components/Pause/PauseSection.js | Fixes countdown timer to clear interval and trigger onChange when pause expires |
| src/popup/index.js | Removes dynamic CSS import from JavaScript |
| src/options/index.js | Removes dynamic CSS import from JavaScript |
| extension/popup.html | Adds static CSS link tag for popup styles |
| extension/options.html | Adds static CSS link tag for options styles |
| package.json | Updates Jest, babel-jest, css-loader, file-loader, web-ext, webpack, and webpack-cli versions |
| web-ext-config.mjs | Converts from CommonJS to ES module syntax |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 11 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "babel-jest": "^26.6.3", | ||
| "babel-jest": "^30.2.0", | ||
| "babel-loader": "^8.2.2", | ||
| "clean-webpack-plugin": "^1.0.1", |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The webpack has been upgraded from v4 to v5, but the clean-webpack-plugin is still at v1.0.1 which is not compatible with webpack 5. This will cause build errors. The plugin should be updated to v3.0.0 or later, or you should use webpack 5's built-in asset cleaning feature by setting 'output.clean: true' in webpack.config.js.
| "clean-webpack-plugin": "^1.0.1", | |
| "clean-webpack-plugin": "^3.0.0", |
| "file-loader": "^6.2.0", | ||
| "jest": "^30.2.0", | ||
| "react-test-renderer": "^16.14.0", | ||
| "style-loader": "^0.23.1", |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The style-loader is still at v0.23.1, which is incompatible with webpack 5. This package should be updated to v3.0.0 or later for webpack 5 compatibility. However, if the intention is to extract CSS into separate files (as suggested by the HTML changes), this should be replaced with mini-css-extract-plugin instead.
| "style-loader": "^0.23.1", | |
| "style-loader": "^3.0.0", |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
npm audit fix --force)Adresses the following Issues:
@raicem