Skip to content

Loading…

Question - two custom filters #1483

Closed
lencc opened this Issue · 5 comments

4 participants

@lencc

I came across 2 rules, here are the examples:

1) ekipa24.si###banner1

2) med.over.net###phorum > .main-container > .clearfix.box-holder > .span-3_2.span > .forum.box-full.box > .post-listing > .main-post.single-post:nth-of-type(5) > .clearfix.oglasnik-addbox

In the first case, I would like to replace "banner1" or "1" with universal character (i.e. with any number).
In the second case, it is similar. I would like to replace number "5" (in this case it is in brackets).

I would like to have a single filter for each rule, if possible. I have tried to replace characters with [id^="-"]
For example: ekipa24.si##[id^="banner-"] and ekipa24.si##banner[id^="-"]

But it doesn't work.

@AlexVallat
Collaborator

Is this really Firefox-specific? It seems unlikely.

@lencc lencc changed the title from [Firefox] Question - two custom filters to Question - two custom filters
@lencc

@AlexVallat it is most likely not Firefox specific. I changed the title.

However, I figured it out. In the second rule, the number (in this case "5") can be simply replaced with "n", since it can be any character. Therefore:
med.over.net###phorum > .main-container > .clearfix.box-holder > .span-3_2.span > .forum.box-full.box > .post-listing > .main-post.single-post:nth-of-type(n) > .clearfix.oglasnik-addbox

Thank you @gwarser for suggestions! The first rule you provided also works well.

@lencc lencc closed this
@gorhill

In the second rule, the number (in this case "5") can be simply replaced with "n"

Simpler to just remove altogether the nth-of-type pseudoclass I suppose:

[...] > .main-post.single-post > [...]
@lencc

@gorhill Correct. This is even better, because it allows me to delete some other subrules. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.