mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
chrome extensions (#4308)
Build chrome extensions that allow interaction with browser content
This commit is contained in:
17
intergrations/extension_chrome/background.js
Normal file
17
intergrations/extension_chrome/background.js
Normal file
@ -0,0 +1,17 @@
|
||||
chrome.runtime.onInstalled.addListener(() => {
|
||||
console.log("Tiện ích đã được cài đặt!");
|
||||
});
|
||||
|
||||
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
if (message.action === "PAGE_INFO") {
|
||||
console.log( message);
|
||||
|
||||
|
||||
chrome.storage.local.set({ pageInfo: message }, () => {
|
||||
console.log("Page info saved to local storage.");
|
||||
});
|
||||
|
||||
// Send a response to the content script
|
||||
sendResponse({ status: "success", message: "Page info received and processed." });
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user