*

Ghany

  • ****
  • 227 posts
please provide me the code to detect non chrome browsers.
« on: August 01, 2017, 02:46:46 PM »
in so many browsers veronika not working well like zara, in many browsers IE and Mozilla firefox and android browsers,
please gave me a code to display message on non chrome browsers like use chrome for better user experience.

hope you will consider this..

i placed in global.js
Code: [Select]
if(/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())){
$('#Msg').hide();
}

and this in head.hp
<div id="Msg">use chrome for a better browsing experience</div>


but this code slow downing my site
can you gave me a better code...
Unlock the power of visibility without breaking the bank - https://www.adycart.in/

*

Ghany

  • ****
  • 227 posts
Re: please provide me the code to detect non chrome browsers.
« Reply #1 on: August 03, 2017, 07:35:43 PM »
I think i will not get support for this, please delete the thread...
Thanks
Unlock the power of visibility without breaking the bank - https://www.adycart.in/

Marked as best answer by frosticek on August 05, 2017, 06:12:54 PM
*

MB Themes

Re: please provide me the code to detect non chrome browsers.
« Reply #2 on: August 04, 2017, 11:52:17 AM »
@Ghany
I recommend to check google. It seems there is easy way to do it via css:
https://stackoverflow.com/questions/4401957/detect-chrome-browser-in-html

Create block, let's say with code:
Code: [Select]
<div id="not-chrome-block">To get best experiece from our site, we recommend to use Chrome (webkit) browsers</div>

then to style.css:
Code: [Select]
#not-chrome-block {display:block;width:100%;position:absolute;font-family:"Open Sans";font-size:13px;position:absolute;top:0;left:0;padding:20px;text-align:center;color:rgba(0,0,0,0.4);background:#F5CF87;box-shadow:0 1px 5px rgba(0,0,0,0.1);}

@media screen and (-webkit-min-device-pixel-ratio:0) {
  #not-chrome-block {display:none;}
}
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

nijamutheen

  • ****
  • 110 posts
Re: please provide me the code to detect non chrome browsers.
« Reply #3 on: August 04, 2017, 02:17:28 PM »
you told second code is style.css and first one is where to put that ?

*

Ghany

  • ****
  • 227 posts
Re: please provide me the code to detect non chrome browsers.
« Reply #4 on: August 04, 2017, 02:32:50 PM »
@nijamutheen
paste it on head.php above this line <?php osc_run_hook('header'); ?>
Unlock the power of visibility without breaking the bank - https://www.adycart.in/

*

nijamutheen

  • ****
  • 110 posts
Re: please provide me the code to detect non chrome browsers.
« Reply #5 on: August 06, 2017, 09:48:50 PM »
sorry it shows all the pages and also looking not good  as soon as  possible make it operamini and ucbrowserr support theme