Skip to content

LJPearson176/browser_plugs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tab Summarizer Chrome Extension

This Chrome extension allows you to summarize all open tabs in your browser using a locally running Ollama instance. Each summary is then saved as a Markdown file, which you can easily add to your Obsidian vault or any other note-taking application.

Features

  • Summarize All Tabs: With a single click, you can process all your open tabs.
  • Local AI Processing: The extension communicates with your local Ollama instance to generate summaries, ensuring your data stays on your machine.
  • Markdown Notes: Each summary is saved as a clean, well-formatted Markdown file.
  • Obsidian-Friendly: The generated Markdown files are perfect for use as atomic notes in Obsidian.
  • Secure: The extension uses the standard Chrome download functionality, so you have full control over where your files are saved.

How to Install

Since this is an unpacked extension, you'll need to load it into Chrome manually.

  1. Download the code: Clone this repository or download it as a ZIP file.
  2. Open Chrome Extensions: Open Chrome and navigate to chrome://extensions.
  3. Enable Developer Mode: In the top right corner, toggle the "Developer mode" switch on.
  4. Load the extension: Click the "Load unpacked" button and select the directory where you downloaded the code.

The extension should now be installed and ready to use.

How to Use

  1. Start your Ollama server: Make sure your local Ollama instance is running. The extension assumes the server is available at http://localhost:11434.
  2. Open some tabs: Open a few tabs with articles or other content you want to summarize.
  3. Click the extension icon: Click the Tab Summarizer icon in your Chrome toolbar.
  4. Start summarizing: In the popup, click the "Summarize and Close Tabs" button.
  5. Save your notes: For each tab, a "Save As" dialog will appear, allowing you to save the generated Markdown file. You can choose to save them directly to your Obsidian vault.
  6. Tabs are closed automatically: Once a tab is processed and the summary is saved, the tab will be closed automatically.

Project Structure

  • manifest.json: The core configuration file for the extension. It defines the permissions, scripts, and other properties of the extension.
  • popup.html: The HTML file for the popup that appears when you click the extension icon.
  • popup.js: The JavaScript file for the popup. It handles the user interaction and sends a message to the background script to start the summarization process.
  • popup.css: The CSS file for styling the popup.
  • background.js: The service worker for the extension. It handles the main logic, including getting the tabs, communicating with the Ollama API, and initiating the file downloads.
  • content.js: This script is injected into each tab to extract the page's content.
  • images/: This directory contains the icons for the extension.

For Developers

Customizing the Ollama Model

You can change the Ollama model used for summarization by editing the background.js file. In the summarizeWithOllama function, you can change the model property in the body of the fetch request.

Improving Content Extraction

The current version of the extension uses document.body.innerText to extract the content of the page. This is a simple approach that works for many websites, but it can be improved. For a more robust solution, you could use a library like Mozilla's Readability.js to extract the main content of the page.

iOS and iPadOS

Chrome on iOS and iPadOS does not support this type of extension. A different approach, such as a Share Sheet extension, would be required to achieve similar functionality on those platforms.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published