User Aliases #2701
Unanswered
OverzealousLotus
asked this question in
Ideas
User Aliases
#2701
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Why?
Sometimes, filters get very long, or some selector chains are repeated in several filters. For example, in this issue, this type of feature is already possible according to the comments, but its syntax is extremely unreadable for someone like me. If you are able to read it, I think we can all agree that it's lengthy and gross. Aliases wouldn't remove some of its problems, but when actually used in filters, having
classes()as a user-defined Alias would be a quality of life change. On top of this, it would remove the need for adding more selectors referring to already existing ones, which gorhill commented about in the issue linked above. It would benefit both users and contributors alike. Another example would be me, I have several filters which use thehas-text()andupward()selectors respectively. I could define something likeupward-text()as my own Alias.How?
I do not think definition in the
My Filterstab would be good, and allocating an entirely different tab for this might be a bit too much. Maybe this can be done inSettings, a sub-tab ofMy Filters, or an external source inAdvanced Settings. Preferably something simple, for both gorhill and users themselves.Why Not?
I do not know how complex this would be to implement, as I am not experienced at all in Javascript. It could also take a toll on uBlock Origin's weight, especially for selectors which require input, such as a
classes()alias. This would probably require variadic functions. Another issue I mentioned above, is space. I have no idea where these aliases should be defined. If anyone takes this into consideration, I thank you for reading this lengthy idea of mine. It popped into my head around two hours ago, and I really felt the need to get it out there after reading DandelionSprout's issue. I hope to hear some feedback soon!Beta Was this translation helpful? Give feedback.
All reactions