Access object window with background Chrome extension

I want to access the properties of an object windowfrom a background script. I have this in manifest.json:

{
    "..": "..",
    "permissions": ["http://*.mysite.net/"],
    "background": {
        "scripts": ["extension.js"]
    }
}

and this is in extension.js:

chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
    if (changeInfo.status === 'complete') {

        var tabWindowObject = ??

        setInterval(tabWindowObject.someFunction, 10);
    }
});

I need this here and not elsewhere (without content scripts and without script). How to get tabWindowObjectin extension.js? In other words, I want to access the tab context inside the Chrome script background.

+4
source share
1 answer

. process, . , window . script, .

+7

Source: https://habr.com/ru/post/1532929/


All Articles