javascript - How do I pass parameter to a `chrome.tabs.executeScript` in a chrome extension? -


when i'm getting message popup want execute script, simply:

chrome.runtime.onmessage.addlistener(function(message, sender, response) {        chrome.tabs.executescript({file: "content.js"}); }); 

my problem: content.js needs data message. how pass it?

try

chrome.runtime.onmessage.addlistener(function(message, sender, response) {     chrome.tabs.executescript({code: paramname=paramvalue},function() {         chrome.tabs.executescript({file: "content.js"});     }); }); 

they both injected same isolated world, content.js can refer same variables.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -