Skip to content

Loading…

whitelist wildcard not working when url contains # as wildcard #1078

Closed
ghost opened this Issue · 5 comments

2 participants

@ghost

uBlock doesn't whitelist when the url contains # as wildcard, after wildcard works.
My actual case is with a youtube video with time stamp and the whitelist channel script which adds the user name at the end of the link for whitelisting.

my case:
whitelist "youtube.com/*&user=example"
https://www.youtube.com/watch?v=VIDEOID&user=example ------------- inactive
https://www.youtube.com/watch?v=VIDEOID#t=100&user=example ---- active! - expected: inactive

test case:
whitelist "example.org/*/page"
http://example.org --------------- active
http://example.org/1/page ----- inactive
http://example.org/1/page# --- inactive
http://example.org/#/page ----- active! - expected: inactive
http://example.org/#/1/page --- active! - expected: inactive

@ghost ghost changed the title from whitelist wildcard not working when url contains # to whitelist wildcard not working when url contains # as wildcard
@gorhill

Yes, the fragment part is removed before testing a match. I didn't expect users wanting to activate/de-activate uBlock depending on the value of the fragment identifier.

I see the greasyfork script adds the &user=[...] at the end, regardless of whether it's adding it to the fragment identifier.

@my-password-is-password

Oh, so the '#' wasn't the comment character? I've been using it to comment since it turns red for '!'.

@gorhill

It is the comment character, if it is the first character.

@gorhill

@anon23462 You say "http://example.org/1/#page --- inactive". Are you sure? I can't reproduce that case, and if you look at it, this is expected, as there is no / before page.

@ghost

Oh, yeah sorry. That one should've been "http://example.org/1/page#" as a case where the whitelisting works since the # is in the url part after the wildcard.

@gorhill gorhill added a commit that closed this issue
@gorhill gorhill this fixes #1078 cc3f33e
@gorhill gorhill closed this in cc3f33e
@andre-hub andre-hub pushed a commit to andre-hub/uBlock that referenced this issue
@gorhill gorhill this fixes #1078 (need confirmation) 61ad54b
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.