init
This commit is contained in:
15
content.js
Normal file
15
content.js
Normal file
@@ -0,0 +1,15 @@
|
||||
(() => {
|
||||
// Simple extraction of visible text
|
||||
const text = document.body.innerText;
|
||||
const url = window.location.href;
|
||||
const title = document.title;
|
||||
|
||||
// Basic cleanup: remove excessive whitespace
|
||||
const cleanText = text.replace(/\s\s+/g, ' ').substring(0, 10000); // Limit to 10k chars for token savings
|
||||
|
||||
return {
|
||||
text: cleanText,
|
||||
url,
|
||||
title
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user