The popup, being an extension page, is not a background page. It is available only when it is open. Thus, the best way to change a popup page based on other information is to initiate a message from the popup itself. I suppose you use the content script to get some information on the page, and then change the popup based on this information. You can either prepare the data, or listen to onMessage in the content of the script itself, or transfer the information to the background image and request it from the popup window. An example of the first may be:
Script Content
...
Popup
chrome.tabs.query({'active': true,'currentWindow':true},function(tab){ chrome.tabs.sendMessage(tab[0].id,"stuff", function(response){
As requested, the man page is used here as an intermediary:
Script Content
// same assumption that info is already defined as the info you want chrome.runtime.sendMessage({'method':'setInfo','info':info});
Background page
var info; chrome.runtime.onMessage(function(message,sender,sendResponse){
Popup
chrome.runtime.sendMessage({'method':'getInfo'},function(response){
Of course, you can save information on the original page better than a simple global var. One good way is to use storage API .
source share