add firefox extension

This commit is contained in:
makaveli10
2023-06-16 19:46:56 +05:30
parent 1a0064b5c7
commit 2825bf4fe5
8 changed files with 517 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
browser.runtime.onMessage.addListener(function(request, sender, sendResponse) {
const { action, data } = request;
if (action === "transcript") {
browser.tabs.query({ active: true, currentWindow: true })
.then((tabs) => {
const tabId = tabs[0].id;
browser.tabs.sendMessage(tabId, { action: "show_transcript", data });
})
.catch((error) => {
console.error("Error retrieving active tab:", error);
});
}
});