//the html is below
<button id="tab-el">SAVE TAB</button>
//the javascript is below
tabEl.addEventListener("click", function(){
chrome.tabs.query({active: true, currentWindow: true}, function(tabs){
myLeads.push(tabs[0].url)
localStorage.setItem("myLeads", JSON.stringify(myLeads) )
render(myLeads)
})
})
//the JSON file is below
{
"manifest_version": 3,
"version": "1.0",
"name": "Leads tracker",
"action": {
"default_popup": "index.html",
"default_icon": "icon.png"
},
"permissions": [
"tabs"
]
}
//the error my chrome console is showing is below
Script.js:51 Uncaught TypeError: Cannot read properties of undefined (reading 'query')
at HTMLButtonElement.<anonymous> (Script.js:51:17)
//tired to grab links from websites to create a bookmark extension but so far not working