Similar to #2937191: Render using theme input and select instead of lists with links for checkboxes and dropdown, many of our projects use the links facets and like many we struggle to keep the wave of naughty bots and crawlers at bay.
Attached is a patch for the 2.x branch of this module which remove the contents of the facet link href attribute and instead stores the href in a data attribute of the link.
The facet JS clicks the link as before, but uses the data attribute instead of the href directly.
We have had some success with this approach, so posting here for others.
Note:
- This does probably wreck accessibly for the links.
- The patch removes a version: VERSION line from the facet library yml file. This is so JS is properly re-aggregated (if you have aggregation enabled.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | facets-2.x-anti-bot-35285020-3.patch | 2.3 KB | mariacha1 |
Issue fork facets-3528502
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
thtas commentedComment #3
mariacha1 commentedHere's a small tweak that allows this to also work with checkboxes.
Comment #4
mariacha1 commentedComment #5
mxr576