I'm writing a Greasemonkey script for a site which at some point modifies location.href
.
How can I get an event (via window.addEventListener
or something similar) when window.location.href
changes on a page? I also need access to the DOM of the document pointing to the new/modified url.
I've seen other solutions which involve timeouts and polling, but I'd like to avoid that if possible.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…