[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: Assistance Javascript/Konqueror request
From:       Vadim Plessky <lucy-ples () mtu-net ! ru>
Date:       2002-05-23 15:32:09
[Download RAW message or body]

On Wednesday 15 May 2002 15:54, Roland Seuhs wrote:
|  Hi!
|
|  I am a PHP-developer and I've got an assignment to extend/rework this
| site:
|
|  http://www.flowerfish.org/hp/index_loged.php
|
|  The menus work with IE, Mozilla and Netscape4 but not with Konqueror 3.0.
|

Hi Roland!

Please consider browser detection code attached to this mail.
Basically, all you want to know is wether browser supports DOM, document.all 
or not.
All this can be done in 3 lines of JS below:
var doc_layers = (document.layers) ? true : false;
var doc_all = (document.all) ? true : false;
var DOM = (document.getElementById) ? true : false;

Detecting browser capabilities via userAgent is not very good idea, as many 
modern browsers can fake UA, and you would not get expected result.

|  Is this a problem of Konqueror or of faulty Javascript code?
|  If the latter, I'd happily fix it, if the former - is there a workaround
| for Konqueror and/or is support for the missing feature(s) planned?

with Konqueror's userAgnet faked as MS IE 5.0, I see menues of your site.
So, Dirk was right: you indeed need to fix browser detection code.
 
|
|  Thanks in advance,
|
|  Roland

-- 

Vadim Plessky
http://kde2.newmail.ru  (English)
33 Window Decorations and 6 Widget Styles for KDE
http://kde2.newmail.ru/kde_themes.html
KDE mini-Themes
http://kde2.newmail.ru/themes/

["Browser_TEST5.html" (text/html)]

<HTML>
<HEAD>
<TITLE>Browser Testing and Extra Information - ver.5</TITLE>
<!-- This test suite was prepared by <a href="mailto:plessky@cnt.ru">Vadim \
                Plessky</a> in 2000,
     to debug different bugs in Konqueror web browser, as well as bugs in weird \
                JavaScript and HTML code on many web sites.
  -->
</HEAD>

<SCRIPT LANGUAGE="JAVASCRIPT">
<!-- hide from non-JavaScript Browsers

document.write("JavaScript code started");

var MyStr="";
var IE4 =0, IE4up= 0;
var NN4 =0, NN4up= 0;
var isKonqueror =0, isOpera =0;


var doc_layers = (document.layers) ? true : false;
var doc_all = (document.all) ? true : false;
var doc_images = (document.images) ? true : false;
var DOM = (document.getElementById) ? true : false;
var nav_mimetypes = (navigator.mimeTypes) ? true : false;
var nav_plugins = (navigator.plugins) ? true : false;



  manufacturer = navigator.appName;
  version = navigator.appVersion;
  major = parseInt(version);
  userAgent = navigator.userAgent;
  agent_lowcase = navigator.userAgent.toLowerCase();
  OS_platform = navigator.platform;
  hasJava=navigator.javaEnabled();
  Netscape_in_UA = (agent_lowcase.indexOf("netscape") != -1);
  MSIE_in_UA = (agent_lowcase.indexOf("msie") != -1);
  isKonqueror = (agent_lowcase.indexOf("konqueror") != -1);
  isOpera = (agent_lowcase.indexOf("opera") != -1);
  isNS6 = (agent_lowcase.indexOf("netscape6") != -1);

  GeckoEngine = (agent_lowcase.indexOf("gecko") != -1 );

  if (manufacturer.indexOf('Netscape')>=0 && version.indexOf('4.0')>=0)
     NN4 = 1;
  if (manufacturer.indexOf('Microsoft')>=0 && version.indexOf('4.0')>=0)
     IE4 = 1;
  if (manufacturer.indexOf('Netscape')>=0 && major >=4 )
     NN4up = 1;
  if (manufacturer.indexOf('Microsoft')>=0 && major >=4 )
     IE4up = 1;


if ( GeckoEngine )
  document.write( "<P><B>Suggestion:</b> you are using browser based on <B>Mozilla \
Gecko</b> engine</P>");

if ( NN4up )
  document.write( "<P><B>Your browser is compatible with Netscape Navigator 4.x and \
higher</b></P>"); if ( IE4up )
  document.write( "<P><B>Your browser is compatible with Microsoft Internet Explorer \
4.x and higher</b></P>");

document.write( "<HR><P>Manufacturer (appName): "+manufacturer+"</P>");
document.write( "<P>Browser version: "+version+"</P>");
document.write( "<P>appCode: "+navigator.appCodeName+"</P>");

document.write( "<P>userAgent: "+navigator.userAgent+"</P>");
document.write( "<P>Operating System Platform: "+OS_platform+"</P>");
document.write( "<P>Is your browser Konqueror: "+isKonqueror);
document.write( "<P>Is your browser Opera: "+isOpera);
document.write( "<P>Is your browser Netscape6: "+isNS6);

document.write( "<P>Is Netscape word present in UserAgent: "+Netscape_in_UA);
document.write( "<P>Is MSIE word present in UserAgent: "+MSIE_in_UA);
document.write( "<P>Is Gecko word present in UserAgent: "+GeckoEngine);

document.write( "<P>screen.Width: "+screen.width+"</P>");
document.write( "<P>screen.Height: "+screen.height+"</P>");

document.write( "<P>screen.pixelDepth: "+screen.pixelDepth+"</P>");
document.write( "<P>screen.colorDepth: "+screen.colorDepth+"</P>");

document.write( "<P>if Java enabled: "+hasJava+"</P>");

document.write( "<P>Document.images: "+doc_images+"</P>");

document.write( "<P>Document.layers: "+doc_layers+"</P>");
document.write( "<P>Document.all: "+doc_all+"</P>");
document.write( "<P>DOM support (Document.getElementById): "+DOM+"</P>");

document.write( "<P>Plugins supported: (navigator.plugins) "+nav_plugins );
document.write( "<P>MIME Types supported: (navigator.mimeTypes) "+nav_mimetypes );

document.write("<HR>JavaScript code finished");
// stop hiding -->
</SCRIPT>
<NOSCRIPT>
<P>Your browser doesn't support scripting.<P>

<P>If you are running Konqueror web browser on KDE2, please check
menu Settings - Configure - Browser dialog, select Java/Javascript tab,
and Enable JavaScript globaly</P>
</NOSCRIPT>

<BODY BGCOLOR="#FFC0A0">

<font size=+2 color="blue" face="sans-serif">
<p>This test should be displayed in any case - even if you don't have JavaScript in \
your browser</p> </font>

<H2>This test suite was prepared by <a href="mailto:plessky@cnt.ru">Vadim Plessky</a> \
in 2000</H2> <P>Objective: to debug different bugs in Konqueror web browser, as well \
as bugs in weird JavaScript and HTML code on many web sites.</P> </BODY>
</HTML>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic