-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
elemhide
(through specifichide
)
Related documentation: - https://help.eyeo.com/en/adblockplus/how-to-write-filters#element-hiding Related feedback/discussion: - https://www.reddit.com/r/uBlockOrigin/comments/d6vxzj/ The `elemhide` filter option as per ABP semantic is now supported. Previously uBO would consider `elemhide` to be an alias of `generichide`. The support of `elemhide` is through the convenient conversion of `elemhide` option into existing `generichide` option and new `specifichide` option. The purpose of the new `specifichide` filter option is to disable all specific cosmetic filters, i.e. those who target a specific site. Additionally, for convenience purpose, the filter options `generichide`, `specifichide` and `elemhide` can be aliased using the shorter forms `ghide`, `shide` and `ehide` respectively.
- Loading branch information
Showing
9 changed files
with
269 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Activate AdGuard Annoyances
Open the logger, browse to
https://en.wikipedia.org/wiki/Lee_Holloway
in another tabAdd
@@||wikipedia.org^$elemhide
to my filters and switch to the logger tab, click on any cosmetic filter shown in the logger from the page load for example --#mw-head-base
Filterlist will not be found just after adding that filter, before adding the filter it would show Adguard Annoyances.
23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not getting any cosmetic filter reported in the logger when using
@@||wikipedia.org^$elemhide
.A reminder that old entries in the logger may not be reverse-looked up properly if the state of uBO changed, this was discussed somewhere in the past, which led to adding the message you see about not finding the filter.
23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting this in uBO debugger console:
after update to b13 and pages stopped loading at all.
I started fiddling with https://testpages.adblockplus.org/en/exceptions/elemhide, maybe related.
23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that msg is to be expected after I add that filter for older entries ?
Total amount of cosmetic filters became 0 after update in Chromium --
Do not reload the page after adding that filter.
23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I added to "My filters" filters from ABP test page. Problem starts after removing/commenting-out exception filter:
@@testpages.adblockplus.org/en/exceptions/elemhide^$elemhide
Just adding it is breaking uBO?!
😪 🛌
23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Picker and Zapper won't work if
$elemhide
is used now, is that to be expected too ?23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gwarser Is this Chromium or Firefox? It's as if your uBO loaded from an invalid selfie, thus causing
this.hostnameSlotsEx is undefined static-ext-filtering.js
. But the selfie magic number has been modified so the invalid selfie should have been scrapped. It's working as expected on my side.23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gwarser I tested back from 1.22.3b12 to 1.22.3b13 and all went well. The ABP test page worked fine and commenting out the filter worked. It's as if your uBO is in a bad state, maybe the storage is corrupted? Try to purge all caches to force a recompile of all filter lists.
@uBlock-user Yes, disabling both generic and specific is the equivalent of toggling off cosmetic filtering and thus this leads to #3212. I expect
elemhide
to rarely occur, it's mostly for filter list purpose (it's easier to just click the no-cosmetic-filtering button), and I see only two instances in whole EasyList.23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh I think I see an issue, but that is not the new code here, it's the change to the selfie manager made in this commit: 915687f#diff-73ef8c4664f2ec8c02320d50b2908efdR1100-R1113.
I need to fix asap before more users suffer the same issues as you do.
23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I was sleepy, it was midnight.
Browser was Firefox Nightly. I had added these filters in b12, noticed I did not updated uBO to latest version, so I did it by checking manually and turning off -> on. I think I noticed higher CPU usage, so interrupting something by turning uBO off/on could caused DB corruption.
I did reproduced right now just by adding filters in b12 and updating to b13.
Side note: Refined GitHub displays number of downloads in Releases -> Assets section. It's now 1.5k for b14 and 6.7k for b12.
23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh. I turned off uBO to post above comment, and after turning it on again all is working fine. (still b13 compiled locally)
List update flushed corrupted selfie?
23c4c80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, selfie is invalidated when filter lists are updated due to change. With b13 you could end up loading an obsolete selfie if there was one available, leading to the error message you saw. Updating to b14 should fix everything.