#1248 enhancement

Selector engine detection

Reported by Victor | May 5th, 2011 @ 12:20 PM | in After 1.7

There is no easy way to detect which selector engine is used in some custom Prototype build, except of

var selector;
if (Prototype.Selector.engine === window.Sizzle) {
    selector = "[v\\:confirm='true'];
} else { // legacy or nwmatcher
    selector = "[v:confirm='true'];

Reason for detection is clear from example: different engines may use different syntax. Maybe add some property pointing to the name of selector engine, e.g.

if (Prototype.Selector.name === "Sizzle") {
    selector = "[v\\:confirm='true'];
} else { // legacy or nwmatcher
    selector = "[v:confirm='true'];

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket