Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Send data (pass message) from a (non content script ) extension component to the 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);
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Send #data #content #script #extension #component #content #script
ADD COMMENT
Topic
Name
9+7 =