chrome.extension.getBackgroundPage()
Returns the JavaScript 'window' object for the background page running inside the current extension.
var background = chrome.extension.getBackgroundPage();
// Now you can get any of your variables from the background object:
var jcvideos = background.jcvideos;
A variable must be accessible at global scope for this to work. Example:
var outer_result = 0;
function example() {
var inner_result = 1; // <-- local variable
outer_result = 2; // <-- global variable
}
// 'inner_result' is undefined outside the function.
// You can only use 'outer_result' from other scripts.
Read more on developer.chrome.com:
About getBackgroundPage()
Background Page Examples