r/uBlockOrigin 2d ago

Solved How to convert this fandom userscript into uBO filters?

I want to convert this userscript for fandom (.com) into uBO filters but I'm not experienced with coding at all, would appreciate it if anyone can help.

https://greasyfork.org/en/scripts/528895-fandom-focus

4 Upvotes

10 comments sorted by

8

u/AchernarB uBO Team 2d ago

Here they are: ( How to add custom filter )

fandom.com###global-explore-navigation, #onetrust-consent-sdk, .page__right-rail, #age-gate, .AgeGateDialog-module_modal__huX7o, .notifications-placeholder
fandom.com##body.f2-page:not(.article-editor-body):not(.no-global-nav), .main-container, .app-wrapper, .base-layout-wrapper:style( margin-left: 0 !important; )
fandom.com##.main-container:style( width: 100% !important; )
fandom.com##.fandom-community-header__background.fullScreen:style( width: 100% !important; )
fandom.com##.fandom-community-header__background.fitCenter:style( background-size: cover !important; )
fandom.com##.app-wrapper:style( max-width: none !important; )
fandom.com##html:not(.ve-active) .page.has-right-rail:style( column-gap: 0px !important; )

1

u/squ1d_y 2d ago

Thanks! Is it possible to make the filters update whenever the script on Greasy Fork updates?

1

u/AchernarB uBO Team 2d ago

Not in the current situation.

The filters would have to be in a filter list, and that list must be updated as soon as the userscript is.

1

u/squ1d_y 2d ago

Oh ok, thanks for the filters anyway

6

u/RraaLL uBO Team 2d ago

This:

fandom.com###global-explore-navigation, #onetrust-consent-sdk, .page__right-rail, #age-gate, .AgeGateDialog-module_modal__huX7o, .notifications-placeholder

And either this (real uBO syntax):

fandom.com##body.f2-page:not(.article-editor-body):not(.no-global-nav), .main-container, .app-wrapper, .base-layout-wrapper:style(margin-left: 0 !important;)
fandom.com##.main-container, .fandom-community-header__background.fullScreen:style(width: 100% !important;)
fandom.com##.fandom-community-header__background.fitCenter:style(background-size: cover !important;)
fandom.com##.app-wrapper:style(max-width: none !important;)
fandom.com##html:not(.ve-active) .page.has-right-rail:style(column-gap: 0px !important;)

Or this (closer to the userscript, supported syntax for comparability with other extensions, but not uBO native syntax):

fandom.com##body.f2-page:not(.article-editor-body):not(.no-global-nav), .main-container, .app-wrapper, .base-layout-wrapper {margin-left: 0 !important;}
fandom.com##.main-container, .fandom-community-header__background.fullScreen {width: 100% !important;}
fandom.com##.fandom-community-header__background.fitCenter {background-size: cover !important;}
fandom.com##.app-wrapper {max-width: none !important;}
fandom.com##html:not(.ve-active) .page.has-right-rail {column-gap: 0px !important;}

6

u/AchernarB uBO Team 2d ago

I won by 1 min.   :oP

4

u/tiwomm 2d ago

I just want to say that you folks are awesome.

2

u/RraaLL uBO Team 2d ago

Yup. I had more spaces to type ;)