|
| 1 | +--- |
| 2 | +title: Sonar Chromium Browser | Native Search Omnibox and Context Menu |
| 3 | +description: Chromium browser patch with native Perplexity Sonar API integration providing omnibox answers and context-menu summarization |
| 4 | +sidebar_position: 15 |
| 5 | +keywords: [sonar, chromium, omnibox, context-menu, summarize, hackathon, api, browser, integration] |
| 6 | +--- |
| 7 | + |
| 8 | + |
| 9 | +**Sonar Chromium Browser** is a Chromium browser patch that natively integrates Perplexity's Sonar API to provide AI-powered functionality directly in the browser. Users can type `sonar <query>` in the omnibox for instant AI answers or select text and right-click "Summarize with Sonar" for quick summaries, streamlining research and browsing workflows. |
| 10 | + |
| 11 | +## Features |
| 12 | + |
| 13 | +* **Omnibox AI Answers** with `sonar <query>` syntax for instant responses |
| 14 | +* **Context-menu Summarization** for selected text with one-click access |
| 15 | +* **Native Browser Integration** using Chromium's omnibox and context-menu APIs |
| 16 | +* **Dual Model Support** using Sonar Pro for omnibox and Sonar for summaries |
| 17 | +* **Debounced Input Handling** for efficient API usage |
| 18 | +* **Custom Browser Build** demonstrating AI integration patterns |
| 19 | + |
| 20 | +## Prerequisites |
| 21 | + |
| 22 | +* Ubuntu 22.04 (WSL2 recommended) |
| 23 | +* Chromium source code checkout |
| 24 | +* Perplexity API key |
| 25 | +* 16GB+ RAM for Chromium build |
| 26 | +* Git and standard build tools |
| 27 | + |
| 28 | +## Installation |
| 29 | + |
| 30 | +```bash |
| 31 | +# Clone the repository |
| 32 | +git clone https://github.com/KoushikBaagh/perplexity-hackathon-chromium.git |
| 33 | +cd perplexity-hackathon-chromium |
| 34 | + |
| 35 | +# Apply patches to Chromium source |
| 36 | +# Follow the README for detailed Chromium setup instructions |
| 37 | +``` |
| 38 | + |
| 39 | +## Configuration |
| 40 | + |
| 41 | +Update API keys in the modified files: |
| 42 | +```cpp |
| 43 | +// In sonar_autocomplete_provider.cc and render_view_context_menu.cc |
| 44 | +const std::string API_KEY = "your_perplexity_api_key_here"; |
| 45 | +``` |
| 46 | + |
| 47 | +## Usage |
| 48 | + |
| 49 | +1. **Build Chromium** with applied patches following the repository instructions |
| 50 | +2. **Launch the custom browser** with AI integration |
| 51 | +3. **Use Omnibox AI**: Type `sonar what is quantum tunneling?` in address bar |
| 52 | +4. **Use Context Summarization**: Select text, right-click "Summarize with Sonar" |
| 53 | + |
| 54 | +## Code Explanation |
| 55 | + |
| 56 | +* **Omnibox Integration**: Custom autocomplete provider hooking into Chromium's omnibox API |
| 57 | +* **Context Menu**: Modified render view context menu for text summarization |
| 58 | +* **API Integration**: Direct Perplexity Sonar API calls with debounced input handling |
| 59 | +* **Model Selection**: Sonar Pro for omnibox queries, Sonar for text summarization |
| 60 | +* **Browser Architecture**: Demonstrates Chromium extension points for AI features |
| 61 | +* **Build Process**: Custom Chromium build with AI patches applied |
| 62 | + |
| 63 | +## Demo Video |
| 64 | + |
| 65 | +<iframe |
| 66 | + className="w-full aspect-video rounded-xl" |
| 67 | + src="https://www.youtube.com/embed/nFhciodeQ-c" |
| 68 | + title="YouTube video player" |
| 69 | + frameBorder="0" |
| 70 | + allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" |
| 71 | + allowFullScreen |
| 72 | +></iframe> |
| 73 | + |
| 74 | +## Links |
| 75 | + |
| 76 | +- [GitHub Repository](https://github.com/KoushikBaagh/perplexity-hackathon-chromium) |
| 77 | +- [Chromium Gerrit Repository](https://chromium-review.googlesource.com/c/chromium/src/+/6778540) |
0 commit comments