You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Christian Sengstock <cs...@gmail.com> on 2007/09/04 12:12:26 UTC
Problems with browser selector
Hi all,
we're working with cocoon 2.1.8.
We use(d) the browser selector to handle different views for different devices.
We always had a lot of problems with the browser selector because it's
just not logical what he does ;)
Maybe someone hacked out !what! the browser selector does and can tell?
Thanx for any hints,
Chris
-----------------------------------------------------------------------------------
just to give you a actual example, i'll demonstrate:
** User-agent string to be matched:
Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95/11.0.026;
Profile/MIDP-2.0 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like
Gecko) Safari/413
** Some test configurations of the map:selector and some (wired) results:
Info:
'Mozilla/5' should be the default desktop browser (not IE);
'NokiaN95' is specific for this device
'Safari/413' are most of the other nokia cellphone browsers
1.)
<browser name="A" useragent="Mozilla/5" />
<browser name="B" useragent="NokiaN95" />
<browser name="C" useragent="Safari/413" />
=> A (cool, first comes first)
2.)
<browser name="B" useragent="NokiaN95" />
<browser name="A" useragent="Mozilla/5" />
<browser name="C" useragent="Safari/413" />
=> A ?
3.)
<browser name="C" useragent="Safari/413" />
<browser name="B" useragent="NokiaN95" />
<browser name="A" useragent="Mozilla/5" />
=> A ??
Okay he likes "Mozilla/5", maybe because it's the first macht in the string?
4.)
<browser name="C" useragent="Safari/413" />
<browser name="B" useragent="NokiaN95" />
=> C
'Safari/413' comes last, so maybe it's the first match in the list yeah?
5.)
<browser name="B" useragent="NokiaN95" />
<browser name="C" useragent="Safari/413" />
=> C ???
okay, what is it then?
6.)
<browser name="B" useragent="NokiaN95" />
<browser name="A" useragent="Mozilla/5" />
=> A ???
7.)
<browser name="A" useragent="Mozilla/5" />
<browser name="B" useragent="NokiaN95" />
=> A ???
... I just can't say what happens.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Problems with browser selector
Posted by Joerg Heinicke <jo...@gmx.de>.
Christian Sengstock <csengstock <at> gmail.com> writes:
> Maybe someone hacked out !what! the browser selector does and can tell?
It's too long ago that I used it to tell from mind how it works, but from the
documentation [1] I'd assume that it is always A, B and C and only the order of
the when expressions in the pipeline matters.
Joerg
[1] http://cocoon.apache.org/2.1/userdocs/default/browser-selector.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org