Blocking scripts in uBlock origin is very easy, if you know the path to an annoying script, it may be easily blocked. Open the dashboard in uBlock origin and use the code below to block the script.
! 2021-05-25 https://boards.4channel.org ||bid.glass/lib/bg.js$script,domain=boards.4channel.org |
This is another example, blocking the end screen and annotations in the Youtube video player.
annotations_module.js$script,domain=youtube.com /endscreen.js$script,domain=www.youtube.com |
This works very well to block unwanted scripts on websites.
This is yet another example this disables tracking code on eBay.
||https://src.ebay-us.com/fp/clear.png ||https://src.ebay-us.com/fp/* ||https://src.ebay-us.com/fp/check.js ||https://src.ebay-us.com/* ||https://ebay-us.com/* ||h-ebay.online-metrix.net/* ||*$websocket |
And finally, blocking annoying advertisements and possible trackers on the CNN website.
! 2021-08-21 https://edition.cnn.com ||securepubads.g.doubleclick.net/tag/js/gpt.js$script,domain=edition.cnn.com ||tag.bounceexchange.com/340/i.js$script,domain=edition.cnn.com ||secure.quantserve.com/quant.js$script,domain=edition.cnn.com ||get.s-onetag.com/c15ddde9-ec7d-4a49-b8ca-7a21bc4b943b/tag.min.js$script,domain=edition.cnn.com ||amplify.outbrain.com/cp/obtp.js$script,domain=edition.cnn.com |