How can I get the current Crome URL?

in my app.js, I’m using current.Window rather than lastFocusedWindow

button_element.addEventListener('click', () => {    
    chrome.tabs.query({active: true, currentWindow: true}, function(tabs){
        arr.push(tabs[0].url)
        localStorage.setItem("example", JSON.stringify(arr) )
        render(arr)
    })
})

That works for pushing the current tab to local storage

Leave a Comment