Bug 74162 - strange rendering of sco.com - lots of text shown that does not seem to be in the source
Summary: strange rendering of sco.com - lots of text shown that does not seem to be in...
Status: RESOLVED INTENTIONAL
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: Slackware Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 74373 75325 87841 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-04 21:07 UTC by Jesper Juhl
Modified: 2004-11-29 11:14 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesper Juhl 2004-02-04 21:07:38 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Slackware Packages
OS:          Linux

if you go to http://sco.com/ with a konqueror from KDE 3.1.x , then the page looks fine. If you go to the same page with Konqueror from KDE 3.2.0 then a lot of lines of text is printed at the top of the page. The text looks like it could be menu items, but when viewing the page source I can't seem to find that text anywhere... something seems to be wrong..
Comment 1 Stephan Kulow 2004-02-04 21:17:17 UTC
set your UA to mozilla or IE and ask their webmaster why they ignore konqueror
Comment 2 Jesper Juhl 2004-02-04 22:13:12 UTC
Ok, using UA == IE 6 fixes it - thank you for that hint.
But, I still find it strange that KDE 3.1.x's Konq can display the page fine while KDE 3.2.0's Konq can't (when ID'ing as itself) - if the old version could handle what the server sends by default, what possible reason could there be for the new version to not handle the same page?
Comment 3 Stephan Kulow 2004-02-06 18:15:28 UTC
*** Bug 74373 has been marked as a duplicate of this bug. ***
Comment 4 Stephan Kulow 2004-02-18 11:29:06 UTC
*** Bug 75325 has been marked as a duplicate of this bug. ***
Comment 5 illogic-al 2004-04-16 23:42:22 UTC
"when viewing the page source I can't seem to find that text anywhere... something seems to be wrong.."
They could easily be hiding the code in php or some other server scripting language. I myself have code like this preventing browsers from seeing my site if they identify themselves as IE.
On a related note it seems that that text only shows up w/ browsers identifying themselves as open source browsers (mozilla, konq, safari, lynx, w3m etc).
Opera and IE are the only ones that work.
Comment 6 Allan Sandfeld 2004-09-20 14:53:48 UTC
Actually this is Konqueror that is no longer capable of rendering the Netscape version of the scripts. Identifying as IE solves the problem, but identifying as Mozilla does not.

After enabling KJS_VERBOSE I discovered that the default scripts that gets loaded by khtml in these sites is the Netscape version.

Even if these sites do not detect Konqueror explicitly I still believe khtml should be able to render the default Netscape code. Expecting websites to specifically recognize konquerors limitations is unrealistic.

I've attached the relevant "line" from loading www.computerworld.com with a Konqueror UserAgent. It contains the script which we unlike <www.computerworld.com/topnavbar/dqm_ie.js> cannot handle.

khtml (jscript): executeScript: caller='' filename=http://www.computerworld.com/topnavbar/dqm_ns.js baseLine=1 script=q39=null;q40=false;q41=null;q20=new Array();q21=new Array();q82=null;q93=null;q94=null;captureEvents(Event.MOUSEUP);window.onmouseup=mclick;if(!window.DQM_cancel_onload){captureEvents(Event.MOUSEMOVE);document.captureEvents(Event.ONLOAD);captureEvents(Event.RESIZE);window.onload=DQM_handleOnload;window.onmousemove=DQM_mousemove;window.onresize=DQM_resize;}document.write("<STYLE TYPE='text/javascript'>");q18=q100();for(var m=0;m<q18;m++)if(subExists[m])writeStyles(m+"");for(var j=0;j<q19.length;j++)writeStyles(q19[j]);document.write("</style>");for(m=0;m<q18;m++)if(subExists[m])q0(m+"");for(j=0;j<q19.length;j++)q0(q19[j]);var q34=new Array(q18);varq35=new Array(q18);var q36=new Array(q18);var q37=new Array(q18);;function writeStyles(mindex){q130=q15("DQM_text_alignment"+mindex,DQM_text_alignment);hltc=q15("DQM_hl_textcolor"+mindex,DQM_hl_textcolor);q144=q15("DQM_textcolor"+mindex,DQM_textcolor);sd="classes.qms"+mindex+".layer.textalign='"+q130+"';classes.qms"+mindex+".layer.fontstyle='"+DQM_fontstyle+"';classes.qms"+mindex+".layer.color='"+q144+"';classes.qms"+mindex+".layer.paddingleft="+DQM_margin_left+";classes.qms"+mindex+".layer.paddingright="+DQM_margin_right+";classes.qms"+mindex+".layer.paddingtop="+DQM_margin_top+";classes.qms"+mindex+".layer.fontsize='"+DQM_fontsize+"px';classes.qms"+mindex+".layer.fontweight='"+DQM_fontweight+"';classes.qms"+mindex+".layer.textdecoration='"+DQM_textdecoration+"';classes.qms"+mindex+".layer.fontfamily='"+DQM_fontfamily+"';";sd+=" classes.hlqm"+mindex+".layer.textalign='"+q130+"';classes.hlqm"+mindex+".layer.fontstyle='"+DQM_fontstyle+"';classes.hlqm"+mindex+".layer.color='"+hltc+"';classes.hlqm"+mindex+".layer.paddingleft="+DQM_margin_left+";classes.hlqm"+mindex+".layer.paddingright="+DQM_margin_right+";classes.hlqm"+mindex+".layer.paddingtop="+DQM_margin_top+";classes.hlqm"+mindex+".layer.paddingbottom="+DQM_margin_bottom+";classes.hlqm"+mindex+".layer.fontsize='"+DQM_fontsize+"px';classes.hlqm"+mindex+".layer.fontweight='"+DQM_fontweight+"';classes.hlqm"+mindex+".layer.textdecoration='"+DQM_hl_textdecoration+"';classes.hlqm"+mindex+".layer.fontfamily='"+DQM_fontfamily+"';";i=0;while(eval("window.DQM_subdesc"+mindex+"_"+i)){id=mindex+"_"+i;if(eval("window.DQM_subdesc"+id+"_0"))q19=q19.concat(new Array(id));i++;}document.write(sd);};function q0(mindex){i=0;level=1;while((i=mindex.indexOf("_",i+1))>-1)level++;bw=q15("DQM_border_width"+mindex,DQM_border_width);q50=q15("DQM_sub_menu_width"+mindex,DQM_sub_menu_width);bc=q15("DQM_border_color"+mindex,DQM_border_color);dh=q15("DQM_divider_height"+mindex,DQM_divider_height);sd="<layer id=qmevent"+mindex+" position=absolute z-index=900001"+level+" top="+0+" left="+0+" width="+(q50+2)+"visibility='hide'";sd+="></layer>";sd+="<layer id=qm"+mindex+" class='test' position=absolute z-index=900000"+level+" top="+0+" left="+0+" width="+q50+" visibility='hide'";if(bc!="transparent")sd+=" bgcolor="+bc;sd+=">";i=0;while(eval("window.DQM_subdesc"+mindex+"_"+i)){id=mindex+"_"+i;iid=-1;tval=eval("window.DQM_icon_index"+mindex+"_"+i);if((tval || tval==0)&& eval("window.DQM_icon_image"+tval)){iid=tval;q52=q33(eval("DQM_icon_image_wh"+iid));q51=eval("window.DQM_icon_rollover"+iid);}q47="position='absolute'left='"+bw+"' top='"+bw+"' width='"+(q50-(bw*2))+"'";q49="";if(iid>-1)q49="' border=0width='"+q52[0]+"' height='"+q52[1]+"'>";tmbgc=q15("DQM_menu_bgcolor"+mindex,DQM_menu_bgcolor);sd+="<layer class='qms"+mindex+"' id=qmitem"+id+" "+q47+" bgcolor='"+tmbgc+"'>";q130=q15("DQM_text_alignment"+mindex,DQM_text_alignment);q125="";if(iid>-1)q125+="<img src='"+eval("DQM_icon_image"+iid)+q49;tval=eval("DQM_subdesc"+id);(q130=="right")? sd+=tval+q125:sd+=q125+tval;q131="";q132="";q129="";q134="";tval=eval("window.DQM_2nd_icon_index"+mindex+"_"+i);if((tval || tval==0)&& eval("window.DQM_2nd_icon_image"+tval)){q126=tval;q127=q33(eval("DQM_2nd_icon_image_wh"+q126));q128=q33(eval("DQM_2nd_icon_image_xy"+q126));q129=eval("DQM_2nd_icon_rollover"+qkhtml (jscript):
Comment 7 Allan Sandfeld 2004-09-20 23:36:54 UTC
While I would have _loved_ to make old NS4-5 ecma-script work ;-)  I found that the following patch adapted and corrected from Safari is a much easier trick. I've verified that is works with my test-cases of www.computerworld.com, www.sco.com and www.journalism.sdu.dk. 

I believe it is safe to spoof "Product" since the recommended way of detecting Konqueror is to look for it in UserAgent or look for "KDE" Vendor. And as I said Safari does it.

--- kjs_navigator.cpp   12 Jul 2004 19:49:09 -0000      1.74
+++ kjs_navigator.cpp   20 Sep 2004 21:26:00 -0000
@@ -193,11 +193,19 @@ Value Navigator::getValueProperty(ExecSt
     // We assume the string is something like Mozilla/version (properties)
     return String(userAgent.mid(userAgent.find('/') + 1));
   case Product:
-    return String("Konqueror/khtml");
+    // When spoofing as IE, we use Undefined().
+    if (userAgent.find(QString::fromLatin1("Microsoft")) >= 0 ||
+        userAgent.find(QString::fromLatin1("MSIE")) >= 0)
+    {
+        return Undefined();
+    }
+    // When acting normal, we pretend to be "Gecko".
+    return String("Gecko");
+//    return String("Konqueror/khtml");
   case ProductSub:
     {
       int ix = userAgent.find("Gecko");

Comment 8 Stephan Kulow 2004-11-29 11:14:15 UTC
*** Bug 87841 has been marked as a duplicate of this bug. ***