File size: 511 Bytes
1a25ebd
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
// 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' });
        });
    }
});