Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS overwrite statements in .yaml file #28

Open
stroobandt opened this issue Jan 12, 2023 · 2 comments
Open

CSS overwrite statements in .yaml file #28

stroobandt opened this issue Jan 12, 2023 · 2 comments

Comments

@stroobandt
Copy link
Contributor

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.

@alandmoore
Copy link
Owner

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?

@stroobandt
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants