ai newsFr., 23. Okt.

I built a Chrome extension that sends any web page to your favorite AI in one click

Hey DEV! 馃憢 I'm hudatech, an indie maker from Vietnam. This is my first post here, so I'll start with the thing I've been building: Page-to-Prompt . The problem I read a lot online, and I kept doing the same thing: select some text, copy it, open an AI tab, paste it, type "summarize this" or "expla

dev.toFreitag 04:32 路 23.10.2 Min. Lesezeit
Bild: dev.to

Hey DEV! 馃憢 I'm hudatech, an indie maker from Vietnam. This is my first post here, so I'll start with the thing I've been building: Page-to-Prompt.

I read a lot online, and I kept doing the same thing: select some text, copy it, open an AI tab, paste it, type "summarize this" or "explain like I'm five", hit enter. Then repeat for the next article.

It's only a few steps, but it adds up. I wanted the page I'm reading and the AI I'm chatting with to be one click apart.

It's a Chrome extension that works as a bridge between the page you're viewing and your AI chat.

You can open it from the right-click menu, or with Cmd + Shift + P (you can change the shortcut on Chrome's extension shortcuts page).

1. Messaging can fail in places you forget about. My shortcut handler sends a message from the background script to the content script of the active tab. It worked great on normal pages, but on pages where no content script is running (like the extension's own options page), Chrome throws Could not establish connection. Receiving end does not exist. The fix was simple: wrap the call in a try/catch and show a friendly message to the user instead of a silent console error.

2. Never hardcode a keyboard shortcut. I first treated Cmd/Ctrl + Shift + P as the extension's shortcut. But users can change it on Chrome's extension shortcuts page, so any check that depends on it has to read the real command shortcut at runtime.

4. Be specific about permissions. Broad permissions like access to all sites need a clear justification in the Chrome Web Store listing. Writing down exactly why each permission is needed forced me to double-check that I really needed it.

Page-to-Prompt is available on the Chrome Web Store.

I'd love your feedback, especially on which prompts you'd want as defaults and which AI sites I should support next. What do you use AI for while browsing? Tell me in the comments 馃憞

Quelle: dev.to (dev.to). Original 枚ffnen