Skip to content

Google Chrome history search - #172

Merged
mattisssa merged 13 commits into
raycast:mainfrom
bromanko:chrome-history
Oct 26, 2021
Merged

mattisssa merged 13 commits into
raycast:mainfrom
bromanko:chrome-history

Conversation

@bromanko

@bromanko bromanko commented Oct 22, 2021 •

Copy link
Copy Markdown
Contributor

I am opening this PR for early feedback. It extends another extension rather than creating a new one. I'm uncertain if folks are OK with that. cc: @rgomezcasas, @thomaspaulmann

Description

This uses the WASM compiled version of sqlite since native modules are
not supported
.

The query for matching is a rudimentary title LIKE '%query%' where
clause. I intend to make this a bit more sophisticated to handle
multiple terms.

It is only using the native throttle support to debounce access to
the database. It's possible that this will need more tuning or better
resource management.

It also does not yet support choosing a specific profile for history.
This would be possible by setting that string in preferences. For now it
defaults to "Default".

Type of change

improvement for somebody else's extension

Screencast

Screen.Recording.2021-10-21.at.9.27.56.PM.mov

Checklist

This uses the WASM compiled version of sqlite since [native modules are
not supported](raycast#135).

The query for matching is a rudimenary `title LIKE '%query%'` where
clause. I intend to make this a bit more sophisticated to handle
multiple terms.

It is only using the native throttle support to debounce access to
the database. It's possible that this will need more tuning or better
resource management.

It also does not yet support choosing a specific profile for history.
This would be possible by setting that string in preferences. For now it
defaults to "Default".
It should use the name of the app as the Subtitle
@bromanko
bromanko marked this pull request as ready for review October 22, 2021 04:31

@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.

Awesome @bromanko 💪 💯

It's the right way to do it, it would be silly to add another extension if it's extendable in this extension.

I have tested your addition and it working very well, good job 💪

Another suggestion is to add yourself to "contributors" instead since there can only be one author according to Metadata and Configuration

Bug found in "change tab" script

If you have a lot of tabs like me it seems like there is a limit somehow, selecting one of the last gives me this error (and not changing tab) CC: @rgomezcasas

DcTWROfEIbwxeABM

I know it's not related to your addition but to the extension itself

Thanks for making this extension even better 💣

Comment thread extensions/google-chrome/package.json Resolved
This improves the database lifecycle management. Now, the db is loaded
once when the component is mounted and disposed when the component is
unmounted.

Note that I have not been able to see the disposal logic get called. I
suspect that this is either due to the way that Raycast handles
extension component lifecycles or the dev environment operating differently.
CMD+C is reserved for global use
@PitNikola PitNikola added the new extension Label for PRs with new extensions label Oct 22, 2021
@pernielsentikaer

Copy link
Copy Markdown
Contributor

Are this one ready to be tested again @bromanko 💪

@bromanko

Copy link
Copy Markdown
Contributor Author

Are this one ready to be tested again @bromanko 💪

Let me add better search logic and then I'll call it done. It's almost complete.

This commit changes the search from comparing the entire string as a
single pattern to tokenizing the words and matching each independently.
All terms must be found for it to match.
@bromanko

Copy link
Copy Markdown
Contributor Author

OK. Have at it.

@thomaspaulmann thomaspaulmann mentioned this pull request Oct 22, 2021
3 tasks done
@hmarr hmarr mentioned this pull request Oct 23, 2021
3 tasks done
@pernielsentikaer

pernielsentikaer commented Oct 23, 2021 •

Copy link
Copy Markdown
Contributor

Awesome @bromanko 🔥

It still seems to fail sometimes when changing tabs (see attached video) - other times when changing tab it's selecting the wrong one and I have to try multiple times to get it right.

za41xS2ZJVAUaAXo.mp4

The second time it actually changed the tab, but not to the right one, and crashed.

c3molgiZc65aFex4.mp4

@bromanko

bromanko commented Oct 23, 2021 via email

Copy link
Copy Markdown
Contributor Author

@pernielsentikaer

Copy link
Copy Markdown
Contributor

You're right 💯 , I'll make an Issue tomorrow about that part instead so it's possible to solve outside this PR.

A small suggestion could be to add date(time) of the history entry, is that possible @bromanko

Awesome work 💪

@pernielsentikaer

Copy link
Copy Markdown
Contributor

@bromanko did you see my latest comment, I'm not sure if it's even possible 😄

Aso, there is a merge conflict that needs to be solved, we are so close to merging it! 🚀

@bromanko

Copy link
Copy Markdown
Contributor Author

I can use the last_visited_at date. I wasn't sure where in the UI to put it. I'll see how accessoryTitle looks.

@bromanko

Copy link
Copy Markdown
Contributor Author

I added ListSection components to group by date. This matches the approach taken by the Chrome "View All History" UI. Let me know if that works.

@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.

Awesome work @bromanko 💪 It looks really 💣

I think we're ready to get this launched 🚀

@mattisssa
mattisssa merged commit 3d0f39c into raycast:main Oct 26, 2021
loris added a commit to loris/extensions that referenced this pull request Nov 7, 2021
* main: (69 commits)
  Make encrypted Bear notes searchable (raycast#253)
  Twitter: Small improvements (raycast#262)
  Add rice score (raycast#207)
  Search npm Packages (raycast#243)
  Add Visual Studio Code Project Manager extension (raycast#216)
  Add Domainr Extension (raycast#181)
  envato extension (raycast#205)
  GitBook: [raycast#152] Update changelog
  Syncing from raycast-macos
  Add information about warnings for tos noncompliance (raycast#250)
  Add Rebrandly extension (raycast#51)
  Kill process improvements (raycast#231)
  Add google translate extension (raycast#201)
  Deepcast: Add PT-PT and PT-BR and replace deprecated EN with EN-US/EN-GB (raycast#242)
  Open With App: Force popToRoot after open action (raycast#245)
  Update pull_request_template.md
  [tower-extension] Add support for branch-names with slashes (raycast#246)
  Google Chrome history search (raycast#172)
  Add Swift Evolution extension (raycast#218)
  Add  Crypto Crawler to get the current coin price. (raycast#110)
  ...

# Conflicts:
#	extensions/safari/src/cloud-tabs.tsx
#	extensions/safari/src/reading-list.tsx
FezVrasta pushed a commit to FezVrasta/extensions that referenced this pull request Nov 24, 2021
* Support for searching Google Chrome history

This uses the WASM compiled version of sqlite since [native modules are
not supported](raycast#135).

The query for matching is a rudimenary `title LIKE '%query%'` where
clause. I intend to make this a bit more sophisticated to handle
multiple terms.

It is only using the native throttle support to debounce access to
the database. It's possible that this will need more tuning or better
resource management.

It also does not yet support choosing a specific profile for history.
This would be possible by setting that string in preferences. For now it
defaults to "Default".

* Fix missing type annotation

* Fix command titles

It should use the name of the app as the Subtitle

* Add title to OpenInBrowserAction

* Move bromanko to contributors

* Improve database lifecycle management

This improves the database lifecycle management. Now, the db is loaded
once when the component is mounted and disposed when the component is
unmounted.

Note that I have not been able to see the disposal logic get called. I
suspect that this is either due to the way that Raycast handles
extension component lifecycles or the dev environment operating differently.

* Change copy to clipboard shortcut

CMD+C is reserved for global use

* Share the favicon code between commands

* Always stringify the error message

* Improve search query

This commit changes the search from comparing the entire string as a
single pattern to tokenizing the words and matching each independently.
All terms must be found for it to match.

* Load the last visit date from database

Chrome stores dates as the number of microseconds since 01/01/1601.

* Group entries by date
gitbook-com Bot pushed a commit that referenced this pull request Dec 21, 2021
jfox85 added a commit to jfox85/raycast-extensions that referenced this pull request Sep 19, 2025