inhumantsar / slurp-extension

Chrome and Firefox extensions for Slurp
MIT License
11 stars 0 forks source link

Slurp Browser Extension

Provides convenient a one-click method for sending pages to Slurp, the plugin for Obsidian that makes it easy to save web pages as clean, easy-to-read Markdown.

How does it work?

When you click the Slurp extension button, it will grab the URL from your active tab and invoke Obsidian using its custom URI. For example, if you're looking at an article on Medium that you would like to save and click the button, it will open a new browser tab and point it at a url like obsidian://slurp?url=https://medium.com/.... From there, Obsidian will pass that URL to the Slurp plugin. Slurp will then read the page, strip it of irrelevant elements like ads and navbars, then convert it to Markdown and save it to your vault.

If you don't already have Slurp for Obsidian, check it out.

Installation

While the Slurp for Obsidian plugin is in the pre-release phase, the extension must be installed manually. Simply download the appropriate package below and open it with your web browser:

Roadmap

Privacy

No data is sent to any third-parties at any point. The URL is passed directly to your local Obsidian installation and all processing is handled locally.

Development

This was built with the Vite Web Extension plugin and NPM. The easiest way to get going while ensuring dependency isolation is to use the included direnv configuration.

Requirements

Clone

git clone https://github.com/inhumantsar/slurp-extension

direnv (optional)

There is a direnv config which can be used to quickly configure a completely isolated local environment. Setting it up requires a few extra steps though.

  1. Install the Nix package manager
  2. Ensure flakes and nix-command are enabled, eg: mkdir -p ~/.local/nix && echo "experimental-features = nix-command flakes" >> nix.conf
  3. Install direnv, adjusting or removing bin_path as needed: curl -sfL https://direnv.net/install.sh | bin_path=~/.local/bin bash
  4. direnv will instruct you to add a line to your .bashrc, once that's done, run direnv allow from the repository root directory.

Building

npm install              # not required if using direnv
npm run build-chrome     # firefox users can run `build-firefox` instead

This will use Vite to package the extension and create a zip file in the repository's root directory containing the extension files.

License

MIT