Webannoyances: Legacy uBO support [issue fixed in uBO Legacy 1.16.4.12]

Created on 11 Dec 2019  ·  13Comments  ·  Source: yourduskquibbles/webannoyances

Related Issue: https://github.com/uBlockOrigin/uBlock-issues/issues/810

Solution: I will create a legacy subscription link that has all sublists subscribed in ultralist.txt to alleviate issue of nested sublists not working in uBO Legacy version.

CC: @reallyuniquename

enhancement in progress solved

Most helpful comment

This issue has been fixed in uBO Legacy 1.16.4.12.

All 13 comments

@reallyuniquename

Are you able to confirm if all sublists are loaded properly when you subscribe to the newly created ultralist_ubo_legacy

I don't run ESR firefox so unable to test if this works as I think it should myself.

Alternative idea if subscribing to the created legacy list doesn't work is to just keep your subscription to original ultralist.txt and also subscribe to CSS Companion Filters list separately.

@yourduskquibbles
Thank for you looking into this issue (not sure how you stumbled upon it).

Unfortunately your ultralist_ubo_legacy.txt does not solve the issue because it includes ultralist.txt that eventually includes css_companion_filters.txt which uBO fails to fetch due to the URL constructor bug https://github.com/uBlockOrigin/uBlock-issues/issues/810.

On top of that uBO completely rejects whole filter list if one of its !#include fails so your second idea would not work either.

The most simple solution is to copy css_companion_filters.txt from /filters to upper folder where ultralist.txt sits. Yes, it's pretty ugly but it should work.

The other way is to maintain separate ultralist_ubo_legacy.txt which would use !#include filters/css_style_filters_legacy.txt that in turn uses !#include filters/css_companion_filters.txt. Essentially, if you want to include lists from /filters subfolder in legacy uBO you must always specify their path as relative to main list location, i.e. always append /filters.

Sorry if dumb question, I'm trying to visualize the solution without being able to test.

It seems like breaking because css_companion_filters.txt is in same subfolder as css_style_filters.txt?

Do you know if I could structure the directories and filter lists in the following fashion and it would work for both legacy and regular uBO?

root Folder

ultralist.txt

root/filters SubFolder

ad_placeholders.txt
css_style_filters.txt
generic_filters.txt
modal_filters.txt
newsletter_filters.txt
social_filters.txt

root/filters/companion Subfolder (link will 404 until I create this hypothetical structure)

css_companion_filters.txt

Then I could update css_style_filters.txt the include would be

!#include companion/css_companion_filters.txt

No, that folder structure would not work. Like I said, if you want legacy uBO to support your list you should always specify sublist path as relative to _topmost_ list location where ultralist.txt is.

TL;DR you can't change folder structure the way it would be supported by both legacy and modern versions of uBO.

Simply _copy_ css_companion_filters.txt to the topmost folder where ultralist.txt sits. That's it.

In the last example css_style_filters.txt would need to use !#include filters/companion/css_companion_filters which would work in legacy uBO but fail in latest uBO.

OK thanks for explain, it seems like there is no 1 good solution to solving for both uBO and legacy uBO.

Options I see are

  1. Move !#include css_companion_filters.txt from css_style_filters.txt into ultralist.txt and have it loaded if someone subscribe to ultralist.txt. Problem would be encountered if user wanted to only subscribe to css_style_filters.txt sublist they wouldn't know to also subscribe to css_companion_filters.txt list at the same time and may experience site breakage if only subscribe to css_style_filters.txt sublist
  2. Fork and maintain a uBO legacy version of Web Annoyances Ultralist
  3. Copy css_companion_filters.txt into root directory and make simultaneous updates to both master/css_companion_filters.txt and master/filters/css_companion_filters.txt

For now option 3 is probably easiest but need to think about it some more before implementing. If you think I missed any possible solutions, feel free to add additional suggestions.

I think you listed all possible solutions and their caveats. Indeed, third option is the quickest one but "the dirtiest" one too. Is it possible to push a symlink to git repo that would be correctly handled by Github?

Actually another alternative to the third option would be to move include of css_companion_filters.txt to ultralist.txt:

! Start Web Annoyances Ultralist

! Start Web Annoyances Ultralist Sublists
!#include filters/ad_placeholders.txt
!#include filters/css_style_filters.txt         ← remove include in this file and 
!#include filters/css_companion_filters.txt     ← move it to the parent file
!#include filters/generic_filters.txt
!#include filters/modal_filters.txt
!#include filters/newsletter_filters.txt
!#include filters/social_filters.txt
! End Web Annoyances Ultralist Sublists

This way both versions of uBO would support it.

Actually another alternative to the third option would be to move include of css_companion_filters.txt to ultralist.txt:

! Start Web Annoyances Ultralist

! Start Web Annoyances Ultralist Sublists
!#include filters/ad_placeholders.txt
!#include filters/css_style_filters.txt         ← remove include in this file and 
!#include filters/css_companion_filters.txt     ← move it to the parent file
!#include filters/generic_filters.txt
!#include filters/modal_filters.txt
!#include filters/newsletter_filters.txt
!#include filters/social_filters.txt
! End Web Annoyances Ultralist Sublists

This way both versions of uBO would support it.

OK if this will work I will probably do that.

One clarification point if you know the answer... does it need to be moved from css_style_filters.txt rather than just duplicated in ultralist.txt & css_style_filters.txt because if I leave in both places, the fetch from css_style_filters.txt would error and cause uBO to throw away all loading due to an error in one of the sublists?

One other possible solution I need to investigate further is the Redirect directive. Will this work in uBO Legacy?

Example of redirect:
Subscribe to https://raw.githubusercontent.com/LanikSJ/ubo-filters/master/filters/admiral-domains.txt
The list will load in standard uBO but then redirect the subscription to load from an updated URL via directive
! Redirect: https://raw.githubusercontent.com/LanikSJ/ubo-filters/master/filters/getadmiral-domains.txt

It absolutely needs to be moved otherwise legacy uBO will disregard ultralist.txt.

if I leave in both places, the fetch from css_style_filters.txt would error and cause uBO to throw away all loading due to an error in one of the sublists

That is correct.

Redirect directive
Will this work in uBO Legacy?

It does work, yes. I am not sure what you are trying to achieve though.

This issue has been fixed in uBO Legacy 1.16.4.12.

@JustOff
Thank you for taking the time to fix it.

@JustOff Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RedDragonWebDesign picture RedDragonWebDesign  ·  3Comments

krystian3w picture krystian3w  ·  10Comments

prodan1234 picture prodan1234  ·  12Comments

gasull picture gasull  ·  13Comments

rd-su picture rd-su  ·  5Comments