Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

blaztar's avatar

How detect and handle old browser (Vuejs)

Hello,

i built one app with VueJs and almost everything went well. I love Vue btw.

But I have problem when user use old browser like IE8. I wonder what is best practise how to detect old browser and how display info message to user.

I tried this https://browser-update.org/ without success.. VueJS app is totaly broken but no warning message..

<script> 
var $buoop = {c:2}; 
function $buo_f(){ 
 var e = document.createElement("script"); 
 e.src = "//browser-update.org/update.min.js"; 
 document.body.appendChild(e);
};
try {document.addEventListener("DOMContentLoaded", $buo_f,false)}
catch(e){window.attachEvent("onload", $buo_f)}
</script> 

The best for me is somehow detect old browser, show error message and hide Vue app completely.

0 likes
1 reply
egyptik's avatar

Had the same problem, here's a simple piece of code that solves the problem:

if(preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']))
{
// IE 10 or lower user
}

if(strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false)
{
// IE 11 user
}

Please or to participate in this conversation.