ally.js
ally.js copied to clipboard
Feature Request(?): Ability to run the browser support tests explicitly
Hey there! 👋
I was wondering if it was possible to expose a way to run the browser support tests explicitly. I have things that trigger off the change of focus and ran down a bug today that was happening because of the browser support tests changing the focus.
I'd love some way to manually and explicitly run the support suite so it can build the localStorage
item, and anywhere we use Ally functions they can use that cached version.
Thanks!
Hey there!
Browser support is evaluated here this function is called internally by any function that requires the supports data. So the tests are executed and cached (in localStorage) by the first ally method you use on an origin.
To kick off the tests manually you could do something like ally.element.disabled(document.body)
at a time that suits you (before any other ally method is used).
That's pretty well what I did, I just wanted to make it more explicit in some way. So it was clear why I was running an ally function at app start-up. At the moment it's just wrapped in a runAllySupportTests
function wrapper to try and make it clear.
ok, so, basically you'd like to expose src/supports/supports
(maybe as initialize()
) via src/ally
to make things more explicit.
That would be ideal I think, just so it's clear what's going on. That and I'm calling a function to throw away the result right now which works but just seems silly.