Bug 81168 - [site-issue] menu script wants window.getSelection()
Summary: [site-issue] menu script wants window.getSelection()
Status: RESOLVED DUPLICATE of bug 174637
Alias: None
Product: konqueror
Classification: Applications
Component: khtml ecma (show other bugs)
Version: unspecified
Platform: Mandrake RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-08 22:47 UTC by Arkadiusz Lipiec
Modified: 2009-05-05 16:54 UTC (History)
0 users

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 Arkadiusz Lipiec 2004-05-08 22:47:53 UTC
Version:            (using KDE KDE 3.2.2)
Installed from:    Mandrake RPMs
OS:          Linux

When you come onto pages:

www.dabster.pl
www.samar.pl

javascript menu doesn't work. There's no problem with other tested browsers: Mozilla, IE, Galeon, Epiphany, Opera... Isn't this strange? Konqueror doesn't event correctly handle CSS standards.
Comment 1 Richard Lärkäng 2004-09-26 16:03:53 UTC
The first one (www.dabster.pl) seems to work if you set the User Agent to Internet Explorer. The second one seems a little broken still though.
Comment 2 Maksim Orlovich 2005-08-12 01:14:23 UTC
#2 needs window.getComputedStyle. The standard way would be defaultView.getComputedStyle
Comment 3 Maksim Orlovich 2005-11-18 03:01:01 UTC
#2 is now fixed... sorta, it crashes some of the time! #1 needs window.getSelection..
Comment 4 J Appel 2006-09-08 22:06:20 UTC
www.dabster.pl 
doesnt work as expected in normal mode (konq 3.5.4), firefox is rendering it nicely.
i see no problems with www.samar.pl. -> confirm
Comment 5 Tommi Tervo 2006-09-08 22:29:53 UTC
Dapster.pl works if using IE6 user agent. http://www.dabster.pl/domMenu.js claims to support konqueror too, but code is propably too old for konqueror 3.5
http://freshmeat.net/projects/dommenu/?topic_id=92
http://mojavelinux.com/cooker/demos/domMenu/Changelog.html
Comment 6 J Appel 2006-09-11 22:44:33 UTC
confirming the dabster.pl part of the report
Comment 7 Maksim Orlovich 2006-09-11 22:58:44 UTC
The problem here is that the script detects us as -both- konqueror and mozilla, and uses the non-standard Mozilla extension window.getSelection() because of that.
Comment 8 J Appel 2006-09-11 23:00:36 UTC
can konqueror handle this differently or is it the sites (script) fault?
Comment 9 Maksim Orlovich 2006-09-11 23:10:01 UTC
Well, we could implement (or at least stub) the extension. Or we could try not to have "gecko" in the user agent string, but that would break a whole bunch of other websites.

Here is the code it runs the first thing when handling hover:
if (domMenu_isGecko) {
   window.getSelection().removeAllRanges();
}

The domMenu_isGecko is set because we have the string "like gecko" in our user agent string.. Then of course window.getSelection returns Undefined, since we don't support this extension, and boom, no menu. If I set the flag to 0 it works, of course. if the website was changed to do feature sniffing here it would work regardless of UA-string, of course..




Comment 10 Maksim Orlovich 2006-09-11 23:12:29 UTC
The latest version of the menu script actually "fixes" it by checking for Mozilla slightly differently:
// safari and konq may use string "khtml, like gecko", so check for destinctive /
var domLib_isGecko = domLib_userAgent.indexOf('gecko/') != -1;

vs:
var domMenu_isGecko = domMenu_userAgent.indexOf('gecko') != -1 ? 1 : 0;
Comment 11 J Appel 2006-09-11 23:52:18 UTC
Maksim, in that case i will call it fixed then because:

a) the problem does no longer occur AND
b) it was the website-script's fault

does that sound sane?
Comment 12 Maksim Orlovich 2006-09-12 02:52:21 UTC
No. The website still doesn't work, so what's fixed about it?
Comment 13 J Appel 2006-09-12 11:12:52 UTC
k. quoting comment no 10: "The latest version of the menu script actually "fixes" it by checking for Mozilla slightly differently:"

sounded like the script has been updated and fixes the problem. i might add that i do not understand the code snippets, in case they obviously tell a different story and make me now look plain stupid now. ^_^
Comment 14 Maksim Orlovich 2009-05-05 16:54:55 UTC

*** This bug has been marked as a duplicate of bug 174637 ***