From f7280be52364ad626fbb5f4464fd39c321cb02af Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Feb 2026 23:21:08 +0000 Subject: [PATCH] feat(browser-extension): add web page clipping functionality - Updated manifest to v1.1.0 with additional permissions (scripting, host_permissions) - Added web clipping context menu items (Clip Full Page, Clip Selection) - Enhanced background.js with PDF conversion using Chrome's printToPDF API - Updated content.js to capture full page HTML and selected content - Added new capture.js script for page capture utilities - Enhanced popup UI with mode toggle between "Send URL" and "Clip Page" - Added support for clipping full pages or selected content to PDF - Updated CSS for new mode buttons and clip section layout Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- browser-extension/manifest.json | 9 +- browser-extension/popup/popup.css | 29 +++ browser-extension/popup/popup.html | 28 ++- browser-extension/popup/popup.js | 207 ++++++++++++++++- browser-extension/scripts/background.js | 283 ++++++++++++++++++++++-- browser-extension/scripts/capture.js | 174 +++++++++++++++ browser-extension/scripts/content.js | 131 ++++++++++- 7 files changed, 830 insertions(+), 31 deletions(-) create mode 100644 browser-extension/scripts/capture.js diff --git a/browser-extension/manifest.json b/browser-extension/manifest.json index d25bdba3..6118007c 100644 --- a/browser-extension/manifest.json +++ b/browser-extension/manifest.json @@ -1,15 +1,16 @@ { "manifest_version": 3, "name": "DocuElevate - Send to Document Processor", - "version": "1.0.0", - "description": "Send files from your browser directly to DocuElevate for processing", + "version": "1.1.0", + "description": "Send files or clip web pages from your browser directly to DocuElevate for processing", "permissions": [ "activeTab", "storage", "contextMenus", - "notifications" + "notifications", + "scripting" ], - "host_permissions": [], + "host_permissions": [""], "action": { "default_popup": "popup/popup.html", "default_icon": { diff --git a/browser-extension/popup/popup.css b/browser-extension/popup/popup.css index ad440377..92e927e1 100644 --- a/browser-extension/popup/popup.css +++ b/browser-extension/popup/popup.css @@ -127,6 +127,35 @@ small { background-color: #5a6268; } +.mode-buttons { + display: flex; + gap: 8px; + margin-bottom: 16px; +} + +.btn-mode { + flex: 1; + background-color: #e9ecef; + color: #495057; + margin-bottom: 0; +} + +.btn-mode:hover { + background-color: #dee2e6; +} + +.btn-mode.active { + background-color: #4CAF50; + color: white; +} + +.clip-buttons { + display: flex; + flex-direction: column; + gap: 8px; + margin-bottom: 8px; +} + .info-box { background-color: #e7f3ff; border: 1px solid #b3d9ff; diff --git a/browser-extension/popup/popup.html b/browser-extension/popup/popup.html index 0ee8885a..dfeb405a 100644 --- a/browser-extension/popup/popup.html +++ b/browser-extension/popup/popup.html @@ -27,8 +27,16 @@ + +