URL problem in JS

RMAG news
saveT.addEventListener(‘click’, function () {
chrome.tabs.query({ currentWindow: true, active: true }, function (tabs) {
myLeads.push(tabs[0].url);
read(myLeads);
})
});

I am trying to get the URL of the currant page for me chrome extension but it dose not working and give me this message in the console

Cannot read properties of undefined (reading ‘query’)
at HTMLButtonElement.<anonymous>

and this my JSON file

{
“manifest_version”: 3,
“version”: “1.0”,
“name”: “Leads Tracker”,
“action”: {
“default_popup”: “Examples.html”,
“default_icon”: “icons8-rfid-signal-80.png”
},
“permissions”: [
“tabs”
]
}

Leave a Reply

Your email address will not be published. Required fields are marked *