about chrome.tabs.executeScript( id,details, callback)
The result of a script is the last expression being evaluated. So in your example you could use: chrome.tabs.executeScript( null, {code:”var x = 10; x”}, function(results){ console.log(results); } ); This will log [10] to the extension’s console. results is actually an array of values because if the page has more than one frame you can … Read more