From 6f94bba9abd2118585af5036ccdb4838b6ed94fa Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 22 May 2020 00:35:29 +0300 Subject: [PATCH] detect opera --- app/pub/scripts/klanviewer.js | 4 ++-- app/views/layout.phtml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/pub/scripts/klanviewer.js b/app/pub/scripts/klanviewer.js index 93aaa13..b94fc24 100644 --- a/app/pub/scripts/klanviewer.js +++ b/app/pub/scripts/klanviewer.js @@ -166,6 +166,7 @@ function startpdfviewer(newcurr){ } var detect = new MobileDetect(window.navigator.userAgent); + var isOpera = window.opera | window.opr | ( navigator.userAgent.indexOf(' OPR/') > -1 ) | ( navigator.userAgent.indexOf(' Coast/') > -1 ) | ( navigator.userAgent.indexOf(' OPiOS/') > -1 ); if (category == 1){ embed = false; @@ -175,10 +176,9 @@ function startpdfviewer(newcurr){ embed = false; } - if(navigator.userAgent.indexOf("Opera")){ + if(isOpera){ embed = true; } - if (embed){ document.getElementById(pdfcanvas).innerHTML = ''; diff --git a/app/views/layout.phtml b/app/views/layout.phtml index 708b610..e3f81ac 100644 --- a/app/views/layout.phtml +++ b/app/views/layout.phtml @@ -4,7 +4,7 @@ "> - +