Version: 4.0 (using KDE 3.1.4) Installed from: compiled sources Compiler: gcc version 3.2.2 OS: Linux (i686) release 2.4.22.2-mark-athlon- I'll start off giving an example: at http://www.howtocreate.co.uk/ try the style switcher. You'll see it works in any recent browser, except Konqueror! My thoughts are that Konqueror overrides the script's setting by its own view menu-setting. It DOES work in Safari and OmniWeb 4.5 (both using the KHTML engine).
I am the author of the stylesheet switcher in question. It does not use the document.styleSheets array (as recommended by the W3C), because: 'Konqueror and Safari [KHTML] incorrectly only populate the document.styleSheets collection with stylesheets that are enabled at any particular instant. The stylesheets cannot be disabled using document.styleSheets, and do not have the title property.' - I assume this should be logged as a separate bug, or someone needs to clarify the W3C's recommendations. Instead, it uses document.getElementsByTagName with LINK elements with REL attribute of 'stylesheet' or 'alternate stylesheet', as well as STYLE elements. It then modifies the disabled property of these elements to switch stylesheets. This technique is the most common in use for switching stylesheets. Another stylesheet switcher (the most popular one in use, which utilises the same technique) on http://www.meyerweb.com/ also fails in Konqueror. In both cases, the stylesheet can still be switched using the 'view' menu.
See also: http://bugs.kde.org/show_bug.cgi?id=54335 Konqueror 3.1: first alternate CSS stylesheet replaces default stylesheet. Javascript can't change style and http://bugs.kde.org/show_bug.cgi?id=43513 'Konqueror 3.0 selects alternate stylesheet instead of default stylesheet'
TarquinWJ, switching with the "View"->"Usw stylesheet" doesn't work with konqueror either.... Just tested KDE 3.2 beta1 (CVS HEAD).... Helge
The JavaScript switcher and the View menu both seem to work now.