growthbook / devtools

GrowthBook DevTools extension for Chrome
MIT License
5 stars 5 forks source link

add option to search by attr #53

Closed LaurinJ closed 5 months ago

LaurinJ commented 8 months ago

To give you some background info. We faced a need to be able to have a custom selector to be able to allow our product team to set up experiments with your visual editor. We could not rely on your editor's selectors from classes because our classes contain hashes that can randomly change because we use CSS modules. We needed a way to assign custom, non-changing IDs to our text elements and we could not use native HTML element IDs because we could not guarantee page-wide uniqueness (we use Intl message IDs as IDs for your tool) A custom attribute specifically for Growthbook was the best option for us. So here is a PR that allows you to specify an identifier attribute that will be preferred by Growthbook when composing the selector.

bttf commented 6 months ago

Hi @LaurinJ I'm not sure this change is useful. It's hardcoding a value into the code, which won't be helpful to everyone. We'll probably want a way to specify a given ID instead

bttf commented 5 months ago

Looks to be stale; please comment if otherwise