[Support] uBlock Origin

(ypsy) #727

Hi, I save a lot of news articles or other web pages as PDF (to archive them) and noticed that cosmetic filters are not active when using Firefoxes print-to-pdf. Some sites have those big popups in the center that make the “printed” pdf completely useless. I tried some website-to-pdf plugins for firefox but they were not satisfying to me. Often they use the internal page-to-pdf functionalities anyway and thus have the same problem.
I can think of two solutions: Either uBlock somehow gets into the pdf-printing engine of firefox and applies the cosmetic filters there. Or uBlock could provice a way to export an html file with cosmetic filters applied. That way I could convert that file using “wkhtmltopdf” or similar. I tried to do this using javascript to get the rendered source code, which sadly also did not have the cosmetic filters applied yet. Also tried to export the html using the developer tools “dom tree as html”. Same results. I even thought of using uBlocks javascript code to filter html (in some sort of standalone mode, without needing a browser) but quickly figured I was way too unexperienced to try it.
So I’d appreciate any help. Thanks in advance.

(gwarser) #728

Some sites have those big popups in the center that make the “printed” pdf completely useless.

Can you share example?

uBlock somehow gets into the pdf-printing engine of firefox and applies the cosmetic filters there

I don’t think it’s possible - these are internal pages, and webextensions does not work on them

uBlock could provice a way to export an html file with cosmetic filters applied.

Not exactly this, but you can use Zap tool to get rid of these elements https://github.com/gorhill/uBlock/wiki/Quick-guide:-popup-user-interface#zap-an-element-on-the-current-page

(ypsy) #729

Any Facebook Post for example. If you’re not logged in, you get this full page “See more of …” thing. If you dismiss it, it’s still 1/3 of the page. On the printed pdf it looks even worse and gets in way with the text.

That’s interesting. The Zaptool does indeed remove it in a way so that it’s not visible in the printed pdf anymore. It’s not very convenient though as it is not remembered and on a lot of tries I did, clicking on the zaptool button didn’t do anything (the zapping mode didn’t start) until I reloaded the page a couple of times and/or disabled/enabled cosmetic filtering. Maybe another bug.

So does anyone have an idea why the changes made with the zaptool apply to printed pdfs and the cosmetic filtering does not?

(gwarser) #730

Because Zap removes elements from document and cosmetic filtering hides them.

(ypsy) #731

I see! So would it be possible to remove them from the document with cosmetic filtering as well or have an option to do so? If this is not too much effort and does not bear any other problems I’d be very glad if a developer could consider this :slight_smile:

(gwarser) #732

This was discussed and will not be implemented for cosmetic filtering (at least for now - you can present your case here: https://github.com/gorhill/uBlock/issues/2252 )

However there is special filtering implemented to remove elements from html source (not from dynamically rendered document) https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#html-filters and seems to work for printing. May help for selected pages where you create your own filters.


I’m using medium mode for ublock origin. I have a lot of rules.
As a feature request, I’d like to be able to sort the rules, by the number of times the rules have been used. This statistic will help me discard old rules, for sites I haven’t used in a long time.

Would I want to keep the number of rules down for performance reasons?

(Graham Perrin) #734

https://github.com/gorhill/uBlock/wiki/Firefox-WebExtensions#read-carefully-if-using-ubowebext might benefit from some updates.

The bug linked from the first bullet point is a duplicate of Mozilla bug 1396395 - Firefox crashes when submitting form

RESOLVED FIXED in Firefox 58

– and the fix (for single-process mode compatibility with AdNauseam, Findx Privacy Control, Ghostery, HTTPS Everywhere, Nano Adblocker, Privacy Badger and uBlock Origin) should be in the next release of Waterfox, probably 56.2.2.

The bug linked from the second bullet point is a duplicate of Mozilla bug 1379148 - document.write does not synchronously modify a document if an extension has content scripts at document_start

VERIFIED FIXED in Firefox 57

uBO’s cache storage

… wiped-out …

If it’s IndexedDB, see:

In particular:

  • comment 34 demonstrating that in some cases, deletion of a type of hidden file should suffice (contrast with suggestions, elsewhere, that it’s necessary to abandon an entire profile)
  • comment 39 proposing a mitigation.

(Graham Perrin) #735

OT from uBlock Origin, you might like this extension:

… Mozilla is experimenting with a browser feature to detect such pop-ups automatically and block them.

(gwarser) #736

Things like this has been requested before and I don’t think will be implemented. There are some performance/architectural problems.

Do you see any slowdowns?

(gwarser) #737

Thank you, updated.

About database problem: I think this problem also happens for “desktop.ini”, “this is uBO database” or “asdf” files - they should find better solution than:

b) Whitelist everything starting with a “.”


No slowdowns I can tell, but I wouldn’t be able to tell unless I had two screens side by side, one processing my rules and one without.

(gwarser) #739

You can always try to measure in specific situations using performance profiling tools, for example https://perf-html.io/ in Firefox. But if you see no obvious slowdowns then no need to worry.

(Graham Perrin) #740


Re: https://www.reddit.com/comments/8ulr8l/-/e1liit9/?context=1 it’s possible that the next release will be 56.3 (not 56.2.2); I’ll revisit this topic in due course.

(Ilike0000) #741

Our clients are experiencing issues with our product (web based) due to ublock blocking our java scripts. How can we get this resolved on a global basis?

(Major Mike) #742

That is almost guaranteed to be a list issue, not a core uBlock issue. You would have to find out which list is blocking your resources and then make your case to them for an exception on their list.

(Ilike0000) #743

Hi Mike,

We’ve had to make exceptions in our Chrome extensions as well for all of our users at our company. I manage and implemented u block origins for our environment and did this through gpo. We’ve had many clients call in to our support and constantly have to walk them through how to do it on their end.


(gwarser) #744

Find out which list is causing your problems https://github.com/gorhill/uBlock/wiki/The-logger#finding-from-which-lists-a-static-filter-originates and use this list support page to report problem.

(Ilike0000) #745

Thank you for the quick responses Mike!

(Major Mike) #746

As @gwarser reiterated, your best approach would be to find the “offending” filter on the list like I said and get it resolved with them. The alternative would be maintaining your own list that corrects for any issues you are facing on the organizational level but that’s a serious undertaking, I would think carefully about that. Good luck.