I have to do something similar to how this works when you press the "quick exit" button https://www.nationaldahelpline.org.uk/
Basically, when you press that button a new tab with Google will open and the initial website will be redirected through a bunch of fake websites so it goes down in user's history.
I solved opening a new tab by using window.open
. Then I tried to do some fake redirects with window.location.replace
in a loop but after the first redirect it's a whole new page so my code is lost...
The backend is in .NET, but I'm not sure if this should be done from frontend or from backend, or a combination of both.
I really don't know how I could achieve this...any help would be appreciated, thanks!
CodePudding user response:
It's not the base site that's redirecting, it's the webserver itself that's listening to http://beta-host.co.uk (clicking that link will redirect you many times, spamming your browser history).
When calling said site, it redirects itself to 312tpfk.beta-host.co.uk and that site redirects to 313tpfk.beta-host.co.uk and that one to 314tpfk.beta-host.co.uk and so on. Each time counting the number up by 1 (312, 313, 314, 315).
The trick here is that it changes only the subdomain, which creates a new browser entry each time.
So, if you want to do that yourself create a redirect on your server that redirects to some up-counting subdomain to create a new browser history entry every time or redirect to that site.
You cannot run javascript in a new page after you destroyed your current one (credits to Quentin)