diff --git a/browser-extension/scripts/capture.js b/browser-extension/scripts/capture.js index d67cbc95..1e6faca3 100644 --- a/browser-extension/scripts/capture.js +++ b/browser-extension/scripts/capture.js @@ -46,6 +46,8 @@ function captureFullPage() { /** * Capture selected content from the page + * Note: For performance, selection clipping uses basic HTML structure without + * per-element computed styles. The resulting PDF will use browser default styles. * @returns {Object} Selection data with HTML, text, and metadata */ function captureSelection() { @@ -92,11 +94,3 @@ function captureSelection() { timestamp: new Date().toISOString() }; } - -// Export functions for use in other scripts -if (typeof module !== 'undefined' && module.exports) { - module.exports = { - captureFullPage, - captureSelection - }; -} diff --git a/browser-extension/scripts/content.js b/browser-extension/scripts/content.js index 3c315066..9ad788e5 100644 --- a/browser-extension/scripts/content.js +++ b/browser-extension/scripts/content.js @@ -45,6 +45,8 @@ function captureFullPage() { /** * Capture selected content from the page + * Note: For performance, uses basic HTML structure without per-element computed styles. + * The resulting PDF will use browser default styles. */ function captureSelection() { const selection = window.getSelection(); @@ -57,27 +59,6 @@ function captureSelection() { const container = document.createElement('div'); container.appendChild(range.cloneContents()); - // Get computed styles for the selection - const elements = container.querySelectorAll('*'); - elements.forEach(el => { - const computed = window.getComputedStyle(el); - // Only preserve essential styles - const essentialStyles = [ - 'font-family', 'font-size', 'font-weight', 'color', - 'background-color', 'text-align', 'margin', 'padding' - ]; - let styleStr = ''; - essentialStyles.forEach(prop => { - const value = computed.getPropertyValue(prop); - if (value) { - styleStr += `${prop}: ${value}; `; - } - }); - if (styleStr) { - el.setAttribute('style', styleStr); - } - }); - const html = `
@@ -99,6 +80,8 @@ function captureSelection() {