Repository navigation
Add WebBlocker extension for productivity and focus - #22715
Conversation
|
Congratulations on your new Raycast extension! 🚀 Due to our current reduced availability, the initial review may take up to 10 business days. Once the PR is approved and merged, the extension will be available on our Store. |
left a comment
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR introduces a new WebBlocker extension for Raycast that provides system-level website blocking functionality on macOS. The extension implements multiple blocking mechanisms including hosts file modification, PF firewall rules, and aggressive DNS cache clearing to ensure blocked websites remain inaccessible across all browsers. The extension includes 5 commands: adding websites to block, enabling/disabling blocking, managing blocked sites, and troubleshooting blocks. The implementation uses system-level privileges, AppleScript for authentication, and comprehensive browser integration to close existing tabs when blocking is enabled. The extension stores data using Raycast's LocalStorage API and includes features like category management, bulk operations, and import/export functionality.
PR Description Notes:
- Title inconsistency: package.json uses "Webblocker" while the PR and other files use "Web Blocker"
- The CHANGELOG entry incorrectly uses a hardcoded date (2025-10-18) instead of the required
{PR_MERGE_DATE}template string
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
extensions/web-blocker/package.json |
3/5 | Defines extension metadata and commands but has title inconsistency and missing @raycast/utils dependency |
extensions/web-blocker/CHANGELOG.md |
3/5 | Documents initial release but uses hardcoded date instead of required {PR_MERGE_DATE} template |
extensions/web-blocker/src/domainUtils.ts |
5/5 | Provides clean domain validation and sanitization utilities with proper TypeScript practices |
extensions/web-blocker/src/storage.ts |
3/5 | Comprehensive storage management but force-clears categories on every read which could cause data loss |
extensions/web-blocker/src/statusVerifier.ts |
4/5 | Provides blocking status verification with good error handling and dynamic imports |
extensions/web-blocker/src/passwordManager.ts |
4/5 | Implements secure session-based authentication caching for system operations |
extensions/web-blocker/src/streamlinedHostsManager.ts |
1/5 | Extremely aggressive system modifications including process killing and network interface manipulation |
extensions/web-blocker/src/browserCacheClearer.ts |
2/5 | Terminates browser processes without consent and performs invasive system-level modifications |
extensions/web-blocker/src/pfFirewallManager.ts |
2/5 | Modifies critical system firewall configuration with potential network connectivity risks |
extensions/web-blocker/src/aggressivePFFirewall.ts |
2/5 | Network-level blocking with IP resolution and connection termination that could affect system stability |
extensions/web-blocker/src/view-blocked-sites.tsx |
2/5 | Feature-rich management interface but has security concerns with file operations and AppleScript usage |
extensions/web-blocker/src/refresh-blocking.tsx |
3/5 | Implements troubleshooting command with proper authentication but has unused imports |
extensions/web-blocker/src/hudHelper.ts |
2/5 | Attempts to extend HUD display time but implementation is fundamentally flawed |
extensions/web-blocker/tsconfig.json |
4/5 | Standard TypeScript configuration with minor output directory concern |
Confidence score: 1/5
- This extension implements extremely aggressive system-level modifications that pose significant risks to system stability and user security
- Score reflects critical concerns with privileged system operations, process termination without consent, network interface manipulation, and firewall configuration changes that could break system networking
- Pay close attention to all system modification files:
streamlinedHostsManager.ts,browserCacheClearer.ts,pfFirewallManager.ts, andaggressivePFFirewall.tswhich contain potentially dangerous operations
14 files reviewed, 16 comments
| try { | ||
| // Resolve IPv4 | ||
| const { stdout: ipv4 } = await execAsync( | ||
| `dig +short ${domain} A 2>/dev/null || true`, |
There was a problem hiding this comment.
logic: Command injection vulnerability - domain parameter is not sanitized before being passed to shell command
| ); | ||
| ipv6.split("\n").forEach((ip) => { | ||
| const trimmed = ip.trim(); | ||
| if (trimmed && trimmed.match(/^[0-9a-f:]+$/i)) { |
There was a problem hiding this comment.
logic: IPv6 regex validation is too permissive and may match invalid addresses containing only colons
|
|
||
| # Add all blocked IPs to the table | ||
| echo "📋 Adding ${ips.length} IPs to block list..." | ||
| ${ips.map((ip) => `pfctl -t webblocker_blocked -T add ${ip} 2>/dev/null || true`).join("\n")} |
There was a problem hiding this comment.
logic: Shell injection vulnerability - IP addresses from DNS resolution are not validated before insertion into shell commands
| const statusText = tempUnblockExpiry | ||
| ? `⏱️ Temporarily unblocked (${domains.length} domains)` | ||
| : isBlockingActive | ||
| ? `🚫 ${domains.length} websites blocked` | ||
| : `✅ ${domains.length} websites ready`; |
There was a problem hiding this comment.
style: Variable statusText is defined but never used in the rendered output
|
|
||
| try { | ||
| // Execute the command with sudo using AppleScript (uses cached admin session) | ||
| const escapedCommand = command.replace(/'/g, "'\\\\\"'\\\\\"'"); |
There was a problem hiding this comment.
logic: Command injection vulnerability - the escaping pattern is insufficient and dangerous
| this.session = null; | ||
| // Also clear sudo timestamp | ||
| try { | ||
| execAsync("sudo -k"); |
There was a problem hiding this comment.
syntax: Missing await - execAsync should be awaited to properly handle the sudo clear operation
| await showHUD(message); | ||
| // Keep the message visible by delaying the next action | ||
| await new Promise((resolve) => setTimeout(resolve, durationMs)); |
There was a problem hiding this comment.
logic: This delay doesn't extend HUD visibility - Raycast controls HUD duration internally. The setTimeout only blocks further execution but won't keep the HUD visible longer. Are you experiencing issues with HUD messages disappearing too quickly, or is this based on an assumption about HUD behavior?
1c54e5a to
e8e616c
Compare
commented
Nov 7, 2025
- Changed disableBlocking() to remove only WebBlocker-tagged entries - Previously replaced entire /etc/hosts file, deleting user's custom entries - Now uses grep -v to filter out only WebBlocker lines - Fixes issue where disabled domains remained in hosts file - Addresses reviewer feedback from @pernielsentikaer
19a7f51 to
06acb93
Compare
|
Thanks a lot for updating the code, @pernielsentikaer! 🙌 I checked everything and fixed the issue — it’s now working perfectly, including proper syncing between the UI and the hosts file. Really appreciate you taking the time to review and improve it — everything’s smooth now! 🚀 |
left a comment
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This review covers only the changes made since the last review, not the entire PR. The changes in this iteration are minimal, with the primary modification being an improvement to the hosts file cleaning logic in streamlinedHostsManager.ts. Instead of completely replacing the hosts file content, the updated logic now preserves existing user entries while only removing WebBlocker-specific entries. This addresses a critical usability issue where users' custom hosts file configurations (such as development environment mappings) would be destroyed. A minor formatting change was also made to package.json fixing capitalization in a command title.
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
| extensions/web-blocker/src/streamlinedHostsManager.ts | 1/5 | Improved hosts file preservation logic but still contains critical command injection vulnerabilities |
| extensions/web-blocker/package.json | 2/5 | Minor formatting fix but still has title inconsistency and non-standard build script |
Confidence score: 1/5
- This PR contains critical security vulnerabilities that make it unsafe to merge
- Score reflects the presence of multiple command injection vulnerabilities and insufficient input sanitization despite the positive improvement to hosts file handling
- Pay close attention to streamlinedHostsManager.ts which needs comprehensive security review and remediation before this extension can be considered safe for production use
2 files reviewed, 1 comment
| echo " ✓ All rules flushed" | ||
|
|
||
| # Flush ALL connection states (this is critical!) | ||
| pfctl -F states 2>/dev/null || true | ||
| pfctl -F state 2>/dev/null || true | ||
| echo " ✓ All connection states cleared" |
There was a problem hiding this comment.
logic: Potentially destructive - flushing all firewall states affects the entire system, not just WebBlocker connections. Should this only flush WebBlocker-related states instead of all system firewall states?
commented
Nov 7, 2025
|
Did you roll many of my corrections back :D |
commented
Nov 7, 2025
|
I can do them again, here I only fixed a few new things |
commented
Nov 8, 2025
|
Thanks a lot, @pernielsentikaer! 🙌 I reviewed your latest changes and everything looks great now — I really appreciate your help polishing the extension. Everything’s working smoothly on my end after the fixes, so I think it’s ready for publishing whenever you’re good with it. Thanks again for taking the time to review and improve it! 🚀 |
… handling - Removed obsolete .eslintrc.json file. - Updated package-lock.json to include new dependencies and updated versions for existing ones. - Enhanced error handling in various components to use showFailureToast for better user feedback. - Refactored TypeScript configuration to target ES2023 and streamline options. - Cleaned up code by removing unused imports and improving consistency across files.
- Simplified .gitignore by removing unnecessary entries and adding Raycast-specific files. - Introduced a new ESLint configuration file to integrate Raycast's ESLint settings.
commented
Nov 14, 2025
|
Published to the Raycast Store: |
commented
Nov 14, 2025
|
🎉 🎉 🎉 Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@ZoroHacker). Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag. |
commented
Nov 15, 2025
|
Thanks so much for publishing the extension, @pernielsentikaer — I really appreciate all your help throughout the review process! 🙌 Everything looks great, but I noticed that the screenshots on the store page aren’t showing up. I’m not sure if I missed a formatting requirement or if something needs to be updated on my side. Could you let me know the correct way to add screenshots so they display properly? Thanks again for all your support — it means a lot! 🚀 |

Description
WebBlocker is a powerful productivity extension that helps users stay focused by blocking distracting websites across all browsers on macOS. Unlike browser extensions that can be easily disabled or bypassed, WebBlocker uses system-level blocking to ensure websites stay blocked—even if they're already open in browser tabs.
Key Features:
Commands:
Perfect For:
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder