Customizable Attribute Name for @selector Lookups #1022
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for an optional
DUSK_HTML_ATTRIBUTE
setting for attribute names besides "dusk" within HTML.Benefits
W3C Compliancy
This will provide a way to achieve W3C compliancy as discussed here and specified here with
data-
prefixes.Transition Support
The attribute can be changed easily during transitory periods where there might be multiple testing engines acting against the same website.
Reduced Exposure
This will allow a more generic attribute name to be chosen to prevent exposing the use of Dusk, Laravel, and PHP to the world. This can help reduce the attack surface for hackers.
Backwards Compatibility
Because the absence of the
DUSK_HTML_ATTRIBUTE
results in the "dusk" default being used, default behavior should be completely unaffected.Note
This also achieves the goal sought in #1012 but achieves it through customization rather than by adding static support for
data-dusk
as a simultaneous attribute todusk
. As such it's a little less invasive while also offering greater flexibility.