temp / Firefox-extension /background.js
NEXAS's picture
Upload 14 files
1a25ebd verified
raw
history blame
No virus
511 Bytes
// background.js
// Example: Listen for a message from the content script and respond
browser.runtime.onMessage.addListener(function (message, sender, sendResponse) {
if (message.action === 'promptUser') {
// Send a message to the content script to prompt the user for input
browser.tabs.query({ active: true, currentWindow: true }, function (tabs) {
const activeTab = tabs[0];
browser.tabs.sendMessage(activeTab.id, { action: 'promptUser' });
});
}
});