-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Increase the ability to query whether the host environment supports a specific event #968
Comments
The way this is down is through event handler attributes, e.g., |
The reason is explained in this document. https://github.com/answershuto/isEventSupports#other-considerations |
This is quite random ... as soon as the Any other concrete example that wouldn't fail expectations? 'cause |
@answershuto I read that, but DOM0 and DOM2 no longer exist so I don't really see how that applies in today's world. |
@WebReflection What about |
If 'onxxxx' in window is used for detection, can 'onxxxx' ensure one-to-one correspondence with supported events? |
Generally we try to maintain that, yes. Of course, sometimes with elements |
@answershuto what about it? const div = document.createElement('div');
div.addEventListener('load', console.log, true);
document.body.appendChild(div).innerHTML = '<img src="/favicon.ico">'; Works pretty well to me. |
We hope to solve the problem of obtaining whether the current host environment itself provides a certain event capability according to the "feature judgment" under the Web standard, so as to know whether a specific event capability can be used in the current host environment.
for example:
Take the dblclick as an example. On the mobile terminal, browsers such as safari and firefox support it, but chrome and android WebView do not. At this time, if we don't have "feature judgment", we need to code like the following.
Obviously, we can implement related functions through "environmental judgment", but when the historical version and the variety of browsers bring a lot of judgment conditions.
We expect to expand on eventTarget to solve this problem.
More detailed content - https://github.com/answershuto/isEventSupports.
The text was updated successfully, but these errors were encountered: