The Un-Official Proxomitron Forum

Full Version: CSS filtering - some browsers ignore it
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using adblocl2privoxy to generate filtering lists, but unable to pinpoint exactly why this happens, but for some hosts on the network with certain browsers it works just right while for others they just do not connect to webserver to get CSS file for element hiding. Could it be related to this? "most browsers will not accept unencrypted redirects as response for https:// requests anyway:"

I tried to change local website to HTTPS but it made no difference for hosts which so far did not connect for CSS and broke it for those that did...

As for browsers Chrome and IE seem to use it now and then, while Firefox even with no addons ignores it completely

Any ideas are welcomed.

Code generated by adblock2privoxy which should make css filtering work for all
Code:
#AbBlock system filters -- don't edit --
SERVER-HEADER-TAGGER: ab2p-block-s
[email protected]*@[email protected]
CLIENT-HEADER-TAGGER: ab2b-unblock-u
[email protected]*@[email protected]
SERVER-HEADER-TAGGER: ab2p-unblock-d
[email protected]*@[email protected]
SERVER-HEADER-TAGGER: ab2p-unblock-s
[email protected]*@[email protected]
SERVER-HEADER-TAGGER: ab2p-handle-as-image-s
[email protected]^content-type(?=:[\s\w]*image\/):.*@[email protected]
CLIENT-HEADER-TAGGER: ab2p-handle-as-image-c
[email protected]^accept(?=:[\s\w]*image\/):.*@[email protected]
SERVER-HEADER-FILTER: ab2p-xframe-filter
[email protected]*\sHTTP\/1.*@$&\r\nX-Frame-Options: [email protected]
CLIENT-HEADER-TAGGER: ab2p-elemhide-check-debug
[email protected]^cookie:.*ab2p-elemhide-filter-debug=true(?:;|$).*@[email protected]
FILTER: ab2p-elemhide-filter
[email protected][^'"\s]\s*<head[^>]*>(?=\s*[^'"\s])@$&<link rel="stylesheet" type="text/css" href="http://192.168.101.101:8445/ab2p.common.css"></link>
<link rel="stylesheet" type="text/css" href="http://192.168.101.101:8445/$host/ab2p.css"></link>@iUD
FILTER: ab2p-elemhide-filter-debug
[email protected][^'"\s]\s*<head[^>]*>(?=\s*[^'"\s])@$&<link rel="stylesheet" type="text/css" href="http://192.168.101.101:8445/debug/ab2p.common.css"></link>
<link rel="stylesheet" type="text/css" href="http://192.168.101.101:8445/$host.debug/ab2p.css"></link>@iUD
FILTER: ab2p-popup-filter
[email protected][^'"\s]\s*<head[^>]*>(?=\s*[^'"\s])@$&<script type="text/javascript">parent==window&&opener&&close()</script>@iUD
firefox->about:config->security.mixed_content.block_active_content
try change this to false?
I tried this setting and Firefox does change things and says in Inspector "Wczytywanie mieszanej (niezabezpieczonej) interaktywnej treści „http://192.168.101.101:8445/www.agatameble.pl/ab2p.css” na zabezpieczonej stronie" which means that is loading that css file, but two things happen
- browser does not show green lock for secure content anymore
- if one is fine with the first it still does not work as no inquiry for css file reaches the webserver.

Well it may be that it is I am using Firefox 52.8 while some changes has been made to it in Firefox 55. I'll see with most recent version.

EDIT: Yeah that was it. Changing that option in Firefox 60 had the desired effect and browser with that option set to false reached for that css file.

EDIT2: I described the problem here and it turns out some sites need also disabled content security policy... I do not think disabling all those security policies is good idea... Having script send content for https sites to local css file also locates in https is essential.
Sorry not to be of any valuable help with this, but possible alternatives are using solutions other than privoxy.
Firefox still has the feature to add in a custom user css (have used with mixed results) . As does IE (for windows users) to add in a custom style sheet.

I still rely on using an extension to add my css to the browsers (chrome and firefox) - for both ad blocking and styling certain web sites. This I use to overcomes the HTTPS sites problem with privoxy unable to natively filter HTTPS.

Best rgards.
If I was going to rely only only browser than installing "uBlock origin" addon would do everything privoxy does just better, as not all adblock rules translate properly to privoxy which is what I found out by extensively testing it for past month and reported all issues I found https://github.com/essandess/adblock2privoxy/issues
Having that said if someone steps up and fixes them than it would be major step ahead in protecting privacy as most addons in browsers could be than deleted as they are used to fingerprint specific users too. One would not also have to worry about installing all rule sets in every browser as they all would work thanks to priovxy even on fresh install of new system.
I say 95% of work is done and it would be shame not to get it fixed up.
(Jun. 05, 2018 08:56 PM)ryszardzonk Wrote: [ -> ]If I was going to rely only only browser than installing "uBlock origin" addon would do everything privoxy does just better, as not all adblock rules translate properly to privoxy which is what I found out by extensively testing it for past month and reported all issues I found https://github.com/essandess/adblock2privoxy/issues
Having that said if someone steps up and fixes them than it would be major step ahead in protecting privacy as most addons in browsers could be than deleted as they are used to fingerprint specific users too. One would not also have to worry about installing all rule sets in every browser as they all would work thanks to priovxy even on fresh install of new system.
I say 95% of work is done and it would be shame not to get it fixed up.

By converting css file to inline css we can avoid mixed content problems. I suggested this feature to adblock2privoxy developer but he don't want to add, so I personally use my own converter "convert2privoxy" to create filter for Privoxy from adblock list, its only problem is it is Windows only but you can install Windows virtual machine on Linux using VirtualBox to use my tool, it is quite easy to install virtual machine anyways, you can download it from here:

Code:
https://app.box.com/s/l7yz7ntxzorg1wupb459vwdyox0q2tl9
https://app.box.com/s/t2wd2bsieqw0rfd1r0nbe5l7l59kezwh

Try to convert EasyList to Privoxy using my tool:
Code:
https://app.box.com/s/y4gmqoyilphwlrl0ki0eeyhrl10jllpr
https://app.box.com/s/3adxail1bgep8hbl7zflbwzsapv89ht1
I have actually overcome most of adblock2privoxy shortcomings by using my scripts to download about 50 different list, mangle them with Linux tools like sed, mix them into one list and only then running actual adblock2privoxy.

Just now I also fixed conversion to privoxy's syntax of number of rules. At least I think I did fix them Wink
https://github.com/essandess/adblock2pri...-407112836

I hope that essandess actually find time to incorporate them into the code. If not than forking it is always possible. BTW Could you post the as an new issue or pull request or any other way code that changes css into inline css? Personally is not all that big issue for me as I already overcome several obstacles on the way and serve content over both http and https with apache from same directory just on different ports, but for others should be great news so they have less to hurdles to get trough.
(Jul. 21, 2018 10:31 PM)cattleyavns Wrote: [ -> ]Try to convert EasyList to Privoxy using my tool:
Code:
https://app.box.com/s/y4gmqoyilphwlrl0ki0eeyhrl10jllpr
https://app.box.com/s/3adxail1bgep8hbl7zflbwzsapv89ht1

@cattleyavns
I copied several lines not understood by adblock2privoxy for element hiding and script injection to Your tool, but I was unable to say what to do with it. I mean I pressed several buttons for which I got several different results, but I have no idea which syntax I got was correct if any...

Some samples
Code:
gry-online.pl#?#.tekst-ramka-blue:-abp-contains(Facebook)
iautomatyka.pl#?#.h2_belka:-abp-contains(Społeczność)
magazynfakty.pl#?#.site-title:-abp-contains(Facebook)
ogloszenioteka.pl#?#div.article.lfloat:-abp-contains(Zapraszamy na nasz profil na Facebooku.)

Code:
neon24.pl##script:inject(abort-on-property-read.js, Service.cookieMonster)
purepc.pl##script:inject(nano-remove-elements-onready.js, .cookiesinfo)
kobietymedycyny.pl##script:inject(abort-current-inline-script.js, $, cookies)
fokusfashion.com##script:inject(abort-on-property-read.js, init_basket_scroll)
fokusfashion.com##script:inject(abort-on-property-read.js, init_login_scroll)
Reference URL's