Open wkABXY opened 3 months ago
same here, is there a way to hook something like afterNavigateEnd
?
window.navigation.addEventListener("navigate", (event) => {
console.log('location changed!', 'from: ', document.URL, 'to: ', event.destination.url);
if (event.destination.url.includes("login")) {
console.log(
"hi there"
)
// do some html injection
// the question is, this logic runs at the time when navigate happens, not when navigate ends
}
})
Note that I want to do the injection only when the document.URL includes "login", how can I achive that without using setTimeout()
?
What happened?
s there a good solution to the issue of the CSUI container getting lost during single-page navigation? This problem also exists in the official example with-content-scripts-ui, where the CSUI container is lost after navigating within the SPA and upon returning.
Version
Latest
What OS are you seeing the problem on?
No response
What browsers are you seeing the problem on?
No response
Relevant log output
No response
(OPTIONAL) Contribution
Code of Conduct