refactor: optimize selection capture and remove dead code
- Removed Node.js export from capture.js (browser-only code) - Simplified selection capture to avoid expensive getComputedStyle() calls - Added performance notes for selection clipping - Aligned content.js with capture.js implementation Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user