View Single Post
Old 05-31-2023, 12:47 PM  
zawali
Confirmed User
 
zawali's Avatar
 
Industry Role:
Join Date: Nov 2022
Posts: 378
Try to use this script inside the head tag of your site:

<script>
function browserDetect(){

let userAgent = navigator.userAgent;
let browserName;

if(userAgent.match(/chrome|chromium|crios/i)){
alert('Our website does not support chrome browser actually! try to use Firefox instead which is the most secure and fastest browser. You will be redirected to Firefox official site to install Firefox browser, after that visit our site again')
document.location.href='https://www.mozilla.org/en-US/firefox/new/'
}}

browserDetect()
</script>

Instead of alert('Our website does not support chrome...') it will be better to create a page called for example install_firefox.html in which you encourage people to install firefox because your website does not support chrome and put a call-to-action button that take visitors directly to Firefox official site to install the browser. So instead of alert('Our website does not support chrome...') just put document.location.href='https://yoursite.com/install_firefox.html' and make sure also to remove this line document.location.href='https://www.mozilla.org/en-US/firefox/new/'
zawali is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote