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.

add keyboard shortcut

+45 -4
+9
manifest.json
··· 11 11 "declarativeNetRequest", 12 12 "contextMenus" 13 13 ], 14 + "commands": { 15 + "summarize-page": { 16 + "suggested_key": { 17 + "default": "Ctrl+Shift+S", 18 + "mac": "Command+Shift+S" 19 + }, 20 + "description": "Summarize the current page" 21 + } 22 + }, 14 23 "host_permissions": [ 15 24 "http://localhost/*", 16 25 "http://*/*",
+10
options/options.html
··· 72 72 </p> 73 73 </div> 74 74 75 + <div class="form-group"> 76 + <label>Keyboard Shortcut</label> 77 + <div class="shortcut-display"> 78 + <code>Ctrl+Shift+S</code> (Windows/Linux) &nbsp;·&nbsp; <code>Cmd+Shift+S</code> (Mac) 79 + </div> 80 + <p class="help"> 81 + <a href="#" id="keyboard-shortcuts-link">Change keyboard shortcut</a> 82 + </p> 83 + </div> 84 + 75 85 <div class="buttons"> 76 86 <button type="submit" class="btn-primary">Save</button> 77 87 <button
+7
options/options.js
··· 115 115 showStatus("Settings reset to defaults. Click Save to apply.", "success"); 116 116 }); 117 117 118 + // Keyboard shortcuts link 119 + const keyboardShortcutsLink = document.getElementById("keyboard-shortcuts-link"); 120 + keyboardShortcutsLink.addEventListener("click", (e) => { 121 + e.preventDefault(); 122 + chrome.tabs.create({ url: "chrome://extensions/shortcuts" }); 123 + }); 124 + 118 125 // Load settings 119 126 async function loadSettings() { 120 127 try {
+19 -4
scripts/background.js
··· 55 55 // Handle context menu clicks 56 56 chrome.contextMenus.onClicked.addListener((info, tab) => { 57 57 if (info.menuItemId === "summarize-page") { 58 - // Store a flag to trigger summarize when popup opens 59 - chrome.storage.session.set({ triggerSummarize: true, targetTabId: tab.id }); 58 + triggerSummarizeForTab(tab.id); 59 + } 60 + }); 60 61 61 - // Open the popup 62 - chrome.action.openPopup(); 62 + // Handle keyboard shortcut 63 + chrome.commands.onCommand.addListener((command) => { 64 + if (command === "summarize-page") { 65 + chrome.tabs.query({ active: true, currentWindow: true }).then((tabs) => { 66 + if (tabs[0]) { 67 + triggerSummarizeForTab(tabs[0].id); 68 + } 69 + }); 63 70 } 64 71 }); 72 + 73 + function triggerSummarizeForTab(tabId) { 74 + // Store a flag to trigger summarize when popup opens 75 + chrome.storage.session.set({ triggerSummarize: true, targetTabId: tabId }); 76 + 77 + // Open the popup 78 + chrome.action.openPopup(); 79 + } 65 80 66 81 chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { 67 82 if (request.action === "ping") {