Working on small chrome extension using manifest v3. Basically I have a line in my code that changes the window location to another page (it is required). The following line is supposed to find the element once the window has changed.
abstract:
window.location = "link to other web"
const element = document.querySelector("div")
console.log(element)
The problem is of course the fact that lines after window.location doesn't work because they do not exist anymore. Is there a way to keep the logic after the refresh/reload?
Perfectly if it would work like selenium (in brower, not in window). As mentioned I'm using manifest v3 api so maybe there is a way to keep the code...