Skip to content

feat(google-chrome): add exclude search functionality - #22614

Merged
raycastbot merged 9 commits into
raycast:mainfrom
fireice009:feature/google-chrome-exclude-search-final
Nov 5, 2025
Merged

raycastbot merged 9 commits into
raycast:mainfrom
fireice009:feature/google-chrome-exclude-search-final

Conversation

@fireice009

@fireice009 fireice009 commented Nov 3, 2025 •

Copy link
Copy Markdown
Contributor
  • Add support for excluding search terms using '-' prefix
  • Example: 'raycast -firefox' finds items containing 'raycast' but not 'firefox'
  • Works across all search functions: tabs, history, bookmarks, and search all
  • Add comprehensive search parser with include/exclude term support
  • Update documentation with usage examples

Description

Screencast

Checklist

- Add support for excluding search terms using '/' prefix
- Users can filter out unwanted results by prefixing terms with '/'
- Example: 'raycast /firefox' finds items containing 'raycast' but not 'firefox'
- Works across all search functions: tabs, history, bookmarks, and search all
- Add comprehensive search parser with include/exclude term support
- Update documentation with usage examples
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: google-chrome Issues related to the google-chrome extension AI Extension platform: macOS labels Nov 3, 2025
@raycastbot

raycastbot commented Nov 3, 2025 •

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @rgomezcasas @bromanko @crisboarna @andreaselia @rtyke @karolre @Aiee @nagauta @a-laughlin @tleo19 @Tarocch1 @rsperezn @drewbabel @haydencbarnes @pernielsentikaer @j3lte you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

You can expect an initial review within five business days.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR adds advanced search functionality to the Google Chrome extension by introducing exclude search terms using a '/' prefix. The implementation creates a centralized search parser utility (search-parser.ts) that handles both include and exclude terms, then integrates this parser across all search hooks (tabs, bookmarks, history). Users can now filter results more precisely - for example, searching "raycast /firefox" will find items containing "raycast" but exclude any containing "firefox". The search parser converts terms to lowercase for case-insensitive matching and handles edge cases like empty queries. The feature maintains backward compatibility while significantly enhancing search capabilities across tabs, history, bookmarks, and the unified search function.

Important Files Changed

Filename Score Overview
extensions/google-chrome/src/util/search-parser.ts 5/5 New utility file implementing core search parsing logic with include/exclude term handling
extensions/google-chrome/README.md 5/5 Updated documentation with comprehensive examples of the new exclude search functionality
extensions/google-chrome/src/hooks/useBookmarkSearch.tsx 4/5 Integrated search parser to enable exclude functionality for bookmark searches
extensions/google-chrome/src/hooks/useHistorySearch.tsx 4/5 Added SQL-based exclude filtering for Chrome history search with proper query building
extensions/google-chrome/CHANGELOG.md 3/5 Added changelog entry but uses actual date instead of required {PR_MERGE_DATE} template
extensions/google-chrome/src/hooks/useTabSearch.tsx 4/5 Enhanced tab search with exclude functionality and improved JSDoc examples

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it maintains backward compatibility and adds valuable functionality
  • Score reflects well-implemented feature with consistent API usage, but changelog date format issue and missing actual date placeholder per guidelines
  • Pay close attention to CHANGELOG.md which needs the date format corrected to use {PR_MERGE_DATE} template string

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread extensions/google-chrome/CHANGELOG.md Resolved
- Fix SQL injection vulnerability by escaping single quotes in search terms
- Improve performance by skipping filtering when no search query is provided
- Handle invalid URLs (e.g., javascript: protocol) gracefully to prevent crashes
- Convert promise chains to async/await for better readability
- Add try-catch protection to Tab class methods (realFavicon, googleFavicon, urlWithoutScheme)
- Add getSafeFavicon helper function to validate URLs before calling getFavicon
- Filter out problematic URL schemes (javascript:, data:, about:, chrome:, file:)
- Pre-validate URL format using new URL() before calling getFavicon
- Fix SQL injection vulnerability by escaping single quotes in search terms
- Gracefully fallback for special protocol URLs
- Prevent extension crashes when encountering bookmarks/history with invalid URLs
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@raycastbot raycastbot added the OP is contributor The OP of the PR is a contributor of the extension label Nov 4, 2025
@pernielsentikaer

Copy link
Copy Markdown
Contributor

@fireice009 can you look into feedback from @a-laughlin

@pernielsentikaer
pernielsentikaer marked this pull request as draft November 4, 2025 06:27
@fireice009
fireice009 marked this pull request as ready for review November 4, 2025 16:37

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This review covers only the changes made since the last review, not the entire PR. The main changes in this update focus on switching the exclude search syntax from / prefix to - prefix (space + dash) based on previous feedback. The developer updated the search parser to use the more conventional - syntax (e.g., raycast -firefox) and added proper escaping support with \- for literal dashes. The README documentation was updated to reflect the new syntax with clear examples, and the CHANGELOG entry was corrected to use the proper {PR_MERGE_DATE} template string. Additional improvements include better error handling for invalid URLs in the Tab class methods and enhanced URL validation in the ChromeListItems component. The search functionality now works consistently across tabs, history, bookmarks, and search-all features with the new standardized syntax.

Important Files Changed

Filename Score Overview
extensions/google-chrome/src/util/search-parser.ts 4/5 Updated search parser to use - prefix instead of / for exclude terms with proper escaping support
extensions/google-chrome/README.md 5/5 Updated documentation to reflect new - syntax with clear examples and usage instructions
extensions/google-chrome/CHANGELOG.md 5/5 Corrected changelog entry to use proper {PR_MERGE_DATE} template string format
extensions/google-chrome/src/components/ChromeListItems.tsx 4/5 Added getSafeFavicon helper for better URL validation and error handling
extensions/google-chrome/src/interfaces/index.ts 3/5 Added broad try-catch blocks to Tab class methods for defensive error handling
extensions/google-chrome/src/hooks/useTabSearch.tsx 4/5 Refactored to use new search parser with async/await and better error handling
extensions/google-chrome/src/hooks/useBookmarkSearch.tsx 4/5 Integrated search parser for consistent exclude functionality across bookmarks
extensions/google-chrome/src/hooks/useHistorySearch.tsx 4/5 Moved filtering to SQL level with proper SQL injection protection

Confidence score: 4/5

  • This PR is safe to merge with minimal risk after addressing the overly broad error handling
  • Score reflects good implementation of the syntax change but deducted one point due to overly broad try-catch blocks in Tab class methods that may mask legitimate errors and make debugging difficult
  • Pay close attention to extensions/google-chrome/src/interfaces/index.ts for the broad error handling that should be more specific

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@pernielsentikaer

Copy link
Copy Markdown
Contributor

@a-laughlin can you check again?

@a-laughlin

Copy link
Copy Markdown
Contributor

Looks great to me. Thanks for making this update @fireice009 ! 🚀

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit 0832469 into raycast:main Nov 5, 2025
@github-actions

github-actions Bot commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

csymons pushed a commit to csymons/raycast-extensions that referenced this pull request Nov 13, 2025
- set RefreshStatus on all command calls
- update dependencies
- fix(scheduler): add missing code changes
- package-lock.json update
- fix: add missing BACKGROUND_REFRESH_STATUS to STORAGE_KEYS
- Pull contributions
- update changelog
- docs: update CHANGELOG for background refresh alert feature
- feat: add background refresh status alert to scheduled command form
- Update CODEOWNERs (b30fad6)
- Add httpperf extension (raycast#22809)
- Update CODEOWNERs (a1b96be)
- Add git extension (raycast#22550)
- Update CODEOWNERs (9c35408)
- Add logos-launcher extension (raycast#22366)
- Update CODEOWNERs (792ccbd)
- Add crypto-portfolio-tracker extension (raycast#22516)
- Update CODEOWNERs (7c738cc)
- chore: update github username (raycast#22634)
- Update CODEOWNERs (2009369)
- feat(screenocr): add option to disable sound and toast message (raycast#22559)
- feat: Vision Support with Pixtral Models and Clipboard Integration (raycast#22724)
- Update CODEOWNERs (76861a7)
- Update deepcast extension (raycast#22830)
- Update CODEOWNERs (4e55cf4)
- [Sink] windows support + shortcuts + modernize (raycast#22850)
- chore(sdk-scw): migrate to new sdk (raycast#22777)
- Improve regex pattern used for Jira issue key detection (raycast#22833)
- Update freeagent extension (raycast#22818)
- Update CODEOWNERs (0fe6eb9)
- [JWT Decoder] Update dependencies (raycast#22411)
- Update CODEOWNERs (05e1779)
- Add grokipedia extension (raycast#22519)
- Update CHANGELOG.md (raycast#22832)
- [VLC] Add commands for speed and history (raycast#22800)
- Update CODEOWNERs (630baf9)
- Update search-router extension (raycast#22823)
- Update CODEOWNERs (660ff27)
- Add excel-formula-beautifier extension (raycast#22578)
- Update CODEOWNERs (f46e7f5)
- Add json-resume extension (raycast#22499)
- Update vps-explorer extension (raycast#22819)
- Update CODEOWNERs (fae2c29)
- Update prism-launcher (raycast#22801)
- Update CODEOWNERs (6c53c0e)
- Update video-downloader extension (raycast#22810)
- Update CODEOWNERs (b4006be)
- Add vps-explorer extension (raycast#22507)
- [Ligue-1] Update extensions (raycast#22806)
- Update `Coolify` extension - delete project (new action) (raycast#22794)
- Update CODEOWNERs (f6d7e48)
- Add `Firefly III` extension (raycast#22795)
- Update CODEOWNERs (cfb46f5)
- Add AI by vercel extension (raycast#22804)
- Update review expectations message in pr-bot (raycast#22734)
- Change fetch URL and parse frontend version (raycast#22751)
- Update CODEOWNERs (61c928e)
- fix(extension): fix zen-browser opening new tab in private window in windows (raycast#22767)
- Update raycast-zoxide extension (raycast#22775)
- Update browser bookmarks extension (raycast#22778)
- Update CODEOWNERs (5898b65)
- Add rule-of-three extension (raycast#22773)
- Update twitch (raycast#22770)
- Update fathom extension (raycast#22760)
- [Postiz] v2 month till EoM + posts in markdown (raycast#22774)
- Update CODEOWNERs (ad1c866)
- Update twitch (raycast#22746)
- Update CODEOWNERs (584953d)
- Add Shelve extension (raycast#22287)
- Update CODEOWNERs (342955a)
- Add ray-code extension (raycast#22755)
- Update qbittorrent (raycast#22756)
- Update CODEOWNERs (c282ff1)
- Update uploadthing (raycast#22763)
- Update cloudflare-warp extension (raycast#22765)
- Update CODEOWNERs (38c5ec8)
- Add `Papra` extension (raycast#22761)
- Update CODEOWNERs (ba06e8c)
- add: Orshot extension (raycast#21715)
- [ivpn] minor fix: error handling in logout command (raycast#22757)
- Update CODEOWNERs (977815a)
- Update steam (raycast#22730)
- Update CODEOWNERs (52b198d)
- feat(imessage-2fa): add support for the 2FA from Epos Card Japan (raycast#22593)
- Update browser history extension (raycast#22749)
- Update `Appwrite` extension - Show Sites, Deployments, Variables (raycast#22754)
- [Multilinks] Add Perplexity Comet browser support (raycast#21476)
- Update anna-s-archive extension (raycast#22739)
- Update CODEOWNERs (fceb40c)
- [ccusage] feat: enhance Node.js path resolution and CLI execution flexibility (raycast#22740)
- Update silent-mode extension (raycast#22738)
- Update CODEOWNERs (8101bc2)
- AppGrid - Smart app launcher with grid view and category grouping (raycast#22709)
- Update CODEOWNERs (c6c796f)
- Add silent-mode extension (raycast#22732)
- feat(ray-so): add nuxt theme preferences (raycast#22733)
- Update CODEOWNERs (6de71ca)
- Add pi-drill extension (raycast#22714)
- Update CODEOWNERs (043ad9b)
- Update bitbucket extension (raycast#22708)
- Update CODEOWNERs (57cbf4b)
- Add ping-menu extension (raycast#22299)
- Docs: Update the utils docs
- Update CODEOWNERs (d3ea74a)
- Add udemy-coupons extension (raycast#22713)
- Update CODEOWNERs (2dfb48e)
- Update qbittorrent (raycast#22728)
- Update CODEOWNERs (7c6269c)
- Add dice-tiles extension (raycast#22021)
- FuelX: Remove vulnerable, but unused, dependencies. (raycast#22727)
- LingoRep: Fix security vulnerabilities. (raycast#22726)
- Update CODEOWNERs (9a3fcb4)
- Add zshrc-manager extension (raycast#22314)
- Update CODEOWNERs (6f5ff61)
- Update parallels-virtual-machines extension (raycast#22676)
- Update CODEOWNERs (a92f1b8)
- Add tex2typst extension (raycast#22667)
- Update CODEOWNERs (dbdf418)
- feat(sound-search): new extension for searching sounds 🎵  (raycast#22590)
- Update skyscanner-flights extension (raycast#22723)
- Update CODEOWNERs (1931677)
- Add rhttp extension (raycast#22359)
- Update `Capacities` extension - Maintenance + Windows Support (raycast#22694)
- Update CODEOWNERs (6f7ed84)
- Add `NetNewsWire` extension (raycast#22717)
- [Chatwoot] search contacts + show unread convo count (raycast#22719)
- Add Ghostty terminal support to Claude Code Launcher (raycast#22706)
- Update knowyourmeme extension (raycast#22705)
- Feature mistral medium (raycast#22633)
- Update CODEOWNERs (10b7497)
- Handle the search favourite space error (raycast#22689)
- Update CODEOWNERs (85f8818)
- Update timezone-buddy extension (raycast#22652)
- Update CODEOWNERs (10af08b)
- Extension: cloudflare (raycast#22660)
- feat(chatgpt-search): Make query parameters configurable, simplify extension (raycast#22677)
- Update CODEOWNERs (33834b7)
- Add prompt-builder extension (raycast#22648)
- Update CODEOWNERs (aa91051)
- Add display-reinitializer extension (raycast#22678)
- Update CODEOWNERs (2780fca)
- Update messages extension (raycast#22687)
- Update CODEOWNERs (cde25cb)
- [gitignore] Windows Support and Favourites (raycast#22623)
- Update CODEOWNERs (6e16a93)
- [Google Search] Release for Windows (