2

GitHub - agzam/browser-hist.el: Search through browser history, in Emacs

 1 year ago
source link: https://github.com/agzam/browser-hist.el
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Search through the Browser history, in Emacs

Description

Browsers usually keep their history in a sqlite database, and it’s trivial to extract it. This package allows you to search through your browser history by URL and the Page Title.

How to use it

1. Install the package using your favorite package manager.

2. Set the mandatory variables

  • browser-hist-db-paths is an association list with paths to browser DBs. It needs to be set! The package currently doesn’t have a way for discovering these paths, so this step has to be done manually.

    example:

    (setq browser-hist-db-paths
          '((chrome . "$HOME/Library/Application Support/Google/Chrome/Default/History")
            (brave . "$HOME/Library/Application Support/BraveSoftware/Brave-Browser/Default/History")
            (firefox . "$HOME/Library/Application Support/Firefox/Profiles/rmgcr4hw.default-release/places.sqlite")))
        

    You may ignore the browsers you don’t use; right now the package works only with a single browser. Retrieving data for multiple browsers will be added at some point.

  • browser-hist-default-browser - set this var, the package doesn’t know yet how to resolve the default browser automatically

    example:

    (setq browser-hist-default-browser 'chrome)
        

3. Try it

There’s only one command browser-hist-search, try it and see if it works.

Status: experimental

I just created it, and it has many rough edges. It’s been tested only on a Mac with Chrome, Brave and Firefox.

What’s the point? Why even have this if you can do it in the browser?

  • It’s convenient and a bit faster to bind the command to a key.
  • And then, using an Embark Action you can open the link in EWW, in XWidget, or any other browser (not necessarily the history origin one).
  • You can also narrow the search and export the results into a separate buffer using Embark Collect.
  • It opens some other possibilities like sending a link to a browser but forcing it to find the tab (if there’s an open one already, e.g., why open another GMail tab?) I’ll share an example of how this could be done using Applescript. Or maybe open the link in a private tab of a chosen browser.
  • I’m also hoping at some point to collect data from multiple browsers.

How come when I type, it highlights within URLs, but not titles

see: #7


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK