mirror of
https://github.com/Mintplex-Labs/anythingllm-extension.git
synced 2026-07-19 22:33:48 -04:00
15 lines
415 B
JavaScript
15 lines
415 B
JavaScript
window.addEventListener("message", (event) => {
|
|
if (event.data.type === "NEW_BROWSER_EXTENSION_CONNECTION") {
|
|
chrome.runtime.sendMessage({
|
|
action: "newApiKey",
|
|
connectionString: event.data.apiKey,
|
|
});
|
|
}
|
|
});
|
|
|
|
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
|
if (request.action === "getPageContent") {
|
|
sendResponse({ content: document.body.innerText });
|
|
}
|
|
});
|