Content-Length: 70386 | pFad | https://dev.to/ahmad777/url-problem-in-js-52d3

7 URL problem in JS - DEV Community

DEV Community

Ahmad
Ahmad

Posted on

URL problem in JS

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

Enter fullscreen mode Exit fullscreen mode

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> 
Enter fullscreen mode Exit fullscreen mode

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"
    ]
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://dev.to/ahmad777/url-problem-in-js-52d3

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy