Skip to content Skip to sidebar Skip to footer

Access Window Object From A Background Chrome Extension

I want to access the properties of a window object from a background script. I have this in manifest.json: { '..': '..', 'permissions': ['http://*.mysite.net/'], 'backg

Solution 1:

You can't. The extension's background page runs in one process, while the tab that was updated runs in a separate process. Different processes can't share objects, so you can't directly access the window object of a tab from an extension's background page. You have to use a content script to get extension code to run inside the tab's process.


Post a Comment for "Access Window Object From A Background Chrome Extension"