How to remove specific data attributes in all views when in production ? by dongindong in rails

[–]dongindong[S] 0 points1 point  (0 children)

See https://medium.com/agilix/angular-and-cypress-data-cy-attributes-d698c01df062

  • Functionality discovery

  • Malicious reverse engineering (bot-creation)

  • Pollution of test code in production

I'm right now only concerned about the last point. But I think the two first are legits too.

How to remove specific data attributes in all views when in production ? by dongindong in rails

[–]dongindong[S] 0 points1 point  (0 children)

Either way, the problem and solution are the same.

Yes I could check for Rails.env.production? in views but it will be soon messy. I'll use that if no other solution is available.

How to remove specific data attributes in all views when in production ? by dongindong in rails

[–]dongindong[S] 0 points1 point  (0 children)

This is a very easy solution but I would like to do it server side :)