mirror of
https://github.com/tcsenpai/spacellama.git
synced 2025-06-10 04:57:39 +00:00
16 lines
586 B
JavaScript
16 lines
586 B
JavaScript
function getPageContent() {
|
|
console.log("getPageContent called");
|
|
return document.body.innerText;
|
|
}
|
|
|
|
browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
|
console.log("Content script received message:", request);
|
|
if (request.action === "getContent") {
|
|
const content = getPageContent();
|
|
console.log("Sending content (first 100 chars):", content.substring(0, 100));
|
|
sendResponse({ content: content });
|
|
}
|
|
return true; // Indicate that we will send a response asynchronously
|
|
});
|
|
|
|
console.log("Content script loaded"); |