Is there anyway for me to make it work so anyone who presses F5 or any refresh button will be moved to a different page, instead of it refreshing the page the user wants?
Something like :
If (refresh){
goto "link to hopme page"
}
If not is there anyway for me to not allow refreshing on a certain page?
I have some people that are are just refreshing non stop and it is killing my bandwidth. It is a game site so I don't want to ban the ip's.
The refresh button in the browser is native and cannot be circumvented. Even if you block the F5 keyboard button (or other keyboard combinations) the user can always click the refresh icon in the browser toolbar.
1. Navigate to chrome://flags/#automatic-tab-discarding. 2. Set Automatic tab discarding to Disabled.
To prevent reload with link onclick without "#", we can call e. preventDefault inside the click event handler. to add a link. to select the link with querySelector .
Perhaps you should be focusing your effort instead on reducing the bandwidth your page is using. Explore the areas of image compression, page optimization and caching.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With