I am making a script in greasemonkey, It will do the next: Look if URL include "ABC" if it include extract the ID, and make new url with the ID extracted, this mainsite will redirect to another site, wait for redirect for open new site.
https://mainsite.com/ABC.aspx?123=XXX&TEST=321&SSID=00000000-0000-0000-0000-000000000000
if (window.location.href.indexOf("ABC") > -1) {
const url = document.URL
const id = url.split('=').pop();
var newURL = "https://newsite.com/" + id
window.location.replace(newURL);
}
I make this script and work fine but I don't know how to make this open the new url only when mainsite.com redirect to another site and not immediately.
Other idea, I check and the site load this:
<img alt="Loading" style="position: absolute; top: 50%; left: 50%; margin-top: -24px; margin-left: -24px" src="aprt/images/loader-green.gif" width="48" height="48">
its possible open the url after this disappear?