Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

chrome extension communication between popup and content script

chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
    chrome.tabs.sendMessage(tabs[0].id, {type:"getText"}, function(response){
        alert(response)
        $("#text").text(response);
    });
});
 
PREVIOUS NEXT
Tagged: #chrome #extension #communication #popup #content #script
ADD COMMENT
Topic
Name
5+1 =