admbrowser icon indicating copy to clipboard operation
admbrowser copied to clipboard

CSS overwrite statements in .yaml file

Open stroobandt opened this issue 2 years ago • 2 comments

This is an idea that originates from the surf browser. Suckless.org's surf is a small WebKit2/GTK+ based browser that I used to use quite often before encountering this great WebEngine/PyQt5 ADMBrowser.

surf allows to write a couple of CSS statements that will overwrite some of the CSS of a known web site. This results to be a handy way to eleminate ads and other annoyances or rather to emphasise parts of a web page one is interested in.

Here is an actual example for some of the named CSS classes of the domain rtl.fr:

.ads, .legal-notice, .newsletter, .produit {display: none !important;}
.hResultPrincipal {font-size: 175% !important;}

CSS overwrite statements would be a great and natural addition to ADMBrowser's .yaml site-dependent configuration files. It would also solve the issue of ADMBrowser users currently being exposed to ads that could be perceived as offensive in an educational or public library setting.

stroobandt avatar Jan 12 '23 16:01 stroobandt

Seems like a reasonable feature to have. Would it be better to have it keyed on some kind of URL regex matched against the primary URL?

alandmoore avatar Jan 12 '23 17:01 alandmoore

Seems like a reasonable feature to have. Would it be better to have it keyed on some kind of URL regex matched against the primary URL?

I would already be very happy when CSS overwriting worked on a URL domain level, but URL regex matching would certainly be a nice refinement, provided it does not complicate matters too much.

Personally, I usually remain on the same domain as the start_url as defined in the .yaml, but I certainly recognise the use cases where URL matching becomes important. That would be when the start_url refers to a search or index page.

stroobandt avatar Jan 12 '23 18:01 stroobandt