This is my manifest.json
:
{
"manifest_version":2,
"name": "Name",
"description": "Description",
"version":"1.0",
"browser_action":
{
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"background": {
"scripts": ["background.js"],
"persistent": false
},
"permissions": [
"tabs"
]
}
Here is my background.js
:
chrome.tabs.onUpdated.addListener( (tabId, changeInfo, tab) => {
if (typeof changeInfo.url !== "undefined" && changeInfo.url.startsWith("chrome://newtab/") === false){
alert(changeInfo.url);
//somehow get the HTML of the page given tabId and store as string
}
});
It will be greatly appreciated if someone can help me out here. As I specified before, I need the exact HTML of the page as the user sees it.