A browser extension that lets you summarize any webpage and ask questions using AI.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add auto-summarize setting with consistent config defaults

- Add auto-summarize checkbox to options page
- Centralize AUTO_SUMMARIZE default in config.js
- Include autoSummarize in API_SETTINGS_DEFAULTS in popup.js
- Initialize autoSummarize in background.js onInstalled handler
- Support both persistent setting and one-time triggers (keyboard/context menu)

+30 -8
+11
options/options.html
··· 235 235 </div> 236 236 237 237 <div class="form-group"> 238 + <label for="auto-summarize"> 239 + <input type="checkbox" id="auto-summarize" /> 240 + Auto-summarize on open 241 + </label> 242 + <p class="help"> 243 + When enabled, the popup will automatically generate a 244 + summary as soon as it opens (no click needed). 245 + </p> 246 + </div> 247 + 248 + <div class="form-group"> 238 249 <label>Keyboard Shortcut</label> 239 250 <div class="shortcut-display"> 240 251 <code>Ctrl+Shift+U</code> (Windows/Linux) &nbsp;·&nbsp;
+5
options/options.js
··· 14 14 const apiKeyInput = document.getElementById("api-key"); 15 15 const disableThinkingInput = document.getElementById("disable-thinking"); 16 16 const thinkingModeGroup = document.getElementById("thinking-mode-group"); 17 + const autoSummarizeInput = document.getElementById("auto-summarize"); 17 18 const statusDiv = document.getElementById("status"); 18 19 const testBtn = document.getElementById("test-connection"); 19 20 const resetBtn = document.getElementById("reset-defaults"); ··· 27 28 accentColor: CONFIG.ACCENTS.DEFAULT_COLOR, 28 29 apiKey: CONFIG.API.KEY, 29 30 disableThinking: CONFIG.API.DISABLE_THINKING, 31 + autoSummarize: CONFIG.API.AUTO_SUMMARIZE, 30 32 }; 31 33 32 34 // Use accent presets from CONFIG ··· 92 94 accentColor: resolveAccentColor(), 93 95 apiKey: apiKeyInput.value.trim(), 94 96 disableThinking: disableThinkingInput.checked, 97 + autoSummarize: autoSummarizeInput.checked, 95 98 }; 96 99 97 100 if (!settings.accentColor) { ··· 181 184 applyAccentColor(CONFIG.ACCENTS.DEFAULT_COLOR); 182 185 apiKeyInput.value = CONFIG.API.KEY; 183 186 disableThinkingInput.checked = CONFIG.API.DISABLE_THINKING; 187 + autoSummarizeInput.checked = false; 184 188 // Show/hide thinking mode group based on API mode 185 189 thinkingModeGroup.style.display = 186 190 CONFIG.API.MODE === "ollama" ? "block" : "none"; ··· 240 244 applyAccentColor(settings.accentColor || CONFIG.ACCENTS.DEFAULT_COLOR); 241 245 apiKeyInput.value = settings.apiKey; 242 246 disableThinkingInput.checked = settings.disableThinking; 247 + autoSummarizeInput.checked = settings.autoSummarize || false; 243 248 // Show/hide thinking mode group based on API mode 244 249 thinkingModeGroup.style.display = 245 250 settings.apiMode === "ollama" ? "block" : "none";
+12 -8
popup/popup.js
··· 59 59 apiKey: CONFIG.API.KEY, 60 60 disableThinking: CONFIG.API.DISABLE_THINKING, 61 61 accentColor: CONFIG.ACCENTS.DEFAULT_COLOR, 62 + autoSummarize: CONFIG.API.AUTO_SUMMARIZE, 62 63 }; 63 64 64 65 async function getApiSettings() { ··· 339 340 summarizeBtn.disabled = true; 340 341 setSummarizeLabel("Loading..."); 341 342 343 + // Check auto-summarize setting 344 + const { autoSummarize } = await chrome.storage.sync.get({ autoSummarize: API_SETTINGS_DEFAULTS.autoSummarize }); 345 + 342 346 // If we have cached content for this tab, restore it 343 347 if (cachedContent && cachedContent.url === currentTabUrl) { 344 348 currentPageContent = cachedContent.content; ··· 357 361 if (cachedChat && cachedChat.messages) { 358 362 chatHistory = cachedChat.messages; 359 363 } 360 - // Restore suggestions if they exist 364 + // Restore suggestions if it exists 361 365 if (cachedSuggestions && cachedSuggestions.suggestions) { 362 366 generatedSuggestions = cachedSuggestions.suggestions; 363 367 } ··· 378 382 showChat(); 379 383 renderChatMessages(); 380 384 } else { 381 - // No summaries yet 385 + // No summaries yet - check if we should auto-summarize 382 386 setSummarizeLabel("Quick Summary"); 387 + if ((autoSummarize || shouldAutoSummarize) && !isLoading && !isExtracting && currentPageContent) { 388 + await generateQuickSummary(); 389 + } 383 390 } 384 391 } else { 385 392 // No cache, extract fresh content ··· 388 395 summarizeBtn.disabled = false; 389 396 setSummarizeLabel("Quick Summary"); 390 397 391 - // Check if we should auto-trigger summarize (from keyboard shortcut or context menu) 392 - if (shouldAutoSummarize) { 393 - // Trigger quick summarize 394 - if (!isLoading && !isExtracting && currentPageContent) { 395 - await generateQuickSummary(); 396 - } 398 + // Check if we should auto-trigger summarize (from keyboard shortcut, context menu, or auto-summarize setting) 399 + if ((autoSummarize || shouldAutoSummarize) && !isLoading && !isExtracting && currentPageContent) { 400 + await generateQuickSummary(); 397 401 } 398 402 } 399 403 });
+1
scripts/background.js
··· 25 25 model: CONFIG.API.MODEL, 26 26 apiKey: CONFIG.API.KEY, 27 27 disableThinking: CONFIG.API.DISABLE_THINKING, 28 + autoSummarize: CONFIG.API.AUTO_SUMMARIZE, 28 29 }); 29 30 } 30 31 });
+1
scripts/config.js
··· 20 20 MODEL: "gpt-oss:20b-cloud", 21 21 KEY: "", 22 22 DISABLE_THINKING: false, 23 + AUTO_SUMMARIZE: false, 23 24 MAX_TOKENS: 2048, 24 25 TEMPERATURE: 0.7, 25 26 TIMEOUT_MS: 30000,