this is my manifest.json
{
"name": "myApplication",
"description": "Build an Extension!",
"version": "1.0",
"manifest_version": 3,
"background": {
"service_worker": "background.js"
},
"permissions": [
"storage",
"tabs",
],
"action": {
"default_popup": "popup.html"
}
}
and this the background.js
chrome.runtime.onConnect.addListener(function(port) {
console.log("entered");
var x = document.querySelectorAll("html");
});
when i execute the extension it appears :Error in event handler: ReferenceError: document is not defined
i want to access the content of the current page, is there not something like chrome.tabs.getcurrent().document ?