Skip to content

Simple EventListenerOptions feature detection #491

@RByers

Description

@RByers

After over a year of debating it we seem no closer to having consensus on a generic mechanism for dictionary feature detection. In the meantime I keep hearing people site the difficulty of feature detection as the biggest problem with passive event listeners. For example @cramforce keeps using this as an example of why performance-sensitive applications often need to do browser-conditional-behavior based on UA-sniffing instead of feature detection.

I'd love to see a generic solution, but I don't have the expertise or time to keep pushing the debate. We've got other APIs already that work around this problem, like mediadevices.getSupportedConstraints. I suggest that for now we just perpetuate that pattern by adding:

  interface EventTarget {
    static AddEventListenerOptions getSupportedOptions();
  }

Which returns a dictionary with each supported option value set to true. Thoughts?
@annevk @dtapuska @tabatkins @domenic @bzbarsky

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions