feat: add cross-browser extension with AI reading assistant

- Create Pi Reader browser extension for Chrome/Firefox
- Chrome uses Side Panel API, Firefox uses Sidebar Action API
- Supports both browsers with separate manifests and unified codebase
- Built with mini-lit components and Tailwind CSS v4
- Features model selection dialog with Ollama support
- Hot reload development server watches both browser builds
- Add useDefineForClassFields: false to fix LitElement reactivity
This commit is contained in:
Mario Zechner 2025-10-01 04:33:56 +02:00
parent c1185c7b95
commit b67c10dfb1
33 changed files with 4453 additions and 1202 deletions

View file

@ -0,0 +1,31 @@
// Dev mode hot reload - check if we're in development
const connectWebSocket = () => {
try {
const ws = new WebSocket("ws://localhost:8765");
ws.onopen = () => {
console.log("[HotReload] Connected to dev server");
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === "reload") {
console.log("[HotReload] Reloading extension...");
chrome.runtime.reload();
}
};
ws.onerror = () => {
console.log("[HotReload] WebSocket error");
// Silent fail - dev server might not be running
};
ws.onclose = () => {
// Reconnect after 2 seconds
setTimeout(connectWebSocket, 2000);
};
} catch (e) {
// Silent fail if WebSocket not available
}
};
connectWebSocket();