[Ext] uBlock Origin

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: [Ext] uBlock Origin

Post by Brummelchen »

strange, i had it working this way after installing 1.1.2b4, ok removed ||
the magic number is 51 and you are probably part of it :p
gorhill
Posts: 163
Joined: February 10th, 2015, 8:00 am

Re: [Ext] uBlock Origin

Post by gorhill »

streetwolf wrote:Is there a way to do this globally?


Per-site cosmetic filters always apply site-wide. In the current case, there is a variable part in one of the class of the DOM element, which varies across pages. If I get rid of this specific class in the cosmetic filter, it seems to work:

Code: Select all

www.cnn.com##.cn--collapsed.cn--expandable.cn--idx-2.cn-list-small-horizontal.cn
User avatar
craigevil
Posts: 3103
Joined: February 20th, 2005, 2:12 pm
Location: OZ
Contact:

Re: [Ext] uBlock Origin

Post by craigevil »

Awesome extension, keep up the good work.
Raspberry PI 400 Distro: Raspberry Pi OS Base: Debian Sid Kernel: 5.15.26-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"
My Giant Sources.list
flaneurb
Posts: 622
Joined: December 10th, 2011, 3:50 am

Re: [Ext] uBlock Origin

Post by flaneurb »

I'm totally delighted with ublock origin. The support that gorhill provides users via the wiki and in this forum and at Wilders is also much appreciated.
Zitronella
Posts: 2
Joined: November 23rd, 2013, 4:23 am

Re: [Ext] uBlock Origin

Post by Zitronella »

@gorhill: thank you for uBlock and uMatrix. Please can you have a look at this issue https://github.com/gorhill/uMatrix/issues/356
johnduncan
Posts: 16
Joined: January 8th, 2015, 7:35 pm

Re: [Ext] uBlock Origin

Post by johnduncan »

This extension has helped to breathe new life into my web experience. Fast page loads, low mem usage, and no advertisements! Thanks for all of your hard work Raymond.
Glanni
Posts: 4
Joined: October 17th, 2015, 7:15 am

Re: [Ext] uBlock Origin

Post by Glanni »

Hello,

i came to uBlock from ABP and until now I am very happy.

I only have one question: There are so many filters available in uBlock. Dont many of them overlap? Is there any disadvantage of activating most of the filters? I guess it takes more memory from Firefox, thats for sure.

But which filters do have more or less the same filters inside?
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: [Ext] uBlock Origin

Post by Brummelchen »

activate the uBlock list, Easylist and some of Fanboy and prebake, thats all.
ofc it takes some memory but less than ABP. or have a look into about:memory.
and sure, they will overlap, you can investigate yourself with the given source links to determine, please dont expect us to do your home work.

and learn how to use the pipette tool to determine ads or empty spaces. well i still read the camp and your "problems"
unfortunately the wiki is only in english available but i am sure you can handle it with bin or google translate ;)
https://github.com/gorhill/uBlock/wiki


hey Raymond - is it possible to filter inline-scripts on content like other scripts?
bad example: http://www.hackintosh.zone/
when i use proxomitron all is fine because it filters several inline scripts concerning the adblock test case.
when i set uBlock disable inline-script it dont get content, is stuck on the spinning wheel. (same when blocking scripts in uMatrix and have uBlock deactivated).

Cheers.
gorhill
Posts: 163
Joined: February 10th, 2015, 8:00 am

Re: [Ext] uBlock Origin

Post by gorhill »

Glanni wrote:Is there any disadvantage of activating most of the filters?
But which filters do have more or less the same filters inside?
Some things to keep in mind as one add more filter lists:

- The more filters the higher probability of web page breakage. In my opinion it's the main thing to worry about when adding more filters.

- uBlock Origin pre-compile filter lists when used, so costly parsing/validating is completely skipped after a filter list has been used a first time.

- uBlock Origin discard duplicates: however before it can check whether a filter is a duplicate or not, the compiled representation of a filter still need to be loaded from permanent storage, so there is still a load time cost.

- Memory should not be a worry: filter representation in memory is very small -- most filters themselves are just plain short strings (no regexp).

- Pure hostname-based filters benefit from specific optimisations for compact memory use and fast lookup -- this code was originally imported from HTTP Switchboard, which had to be able to efficiency load and enforce tens of thousands of hostnames from blacklists.

You will find out what filter lists overlap as you make use of them: uBlock Origin may report that 0 or only a subset of filters are used from a specific filter list: this means the filters not in use were found in other filter lists.
Last edited by gorhill on October 17th, 2015, 10:01 am, edited 1 time in total.
gorhill
Posts: 163
Joined: February 10th, 2015, 8:00 am

Re: [Ext] uBlock Origin

Post by gorhill »

Brummelchen wrote:when i set uBlock disable inline-script it dont get content, is stuck on the spinning wheel.
It's because inline scripting is disabled through the injection of a Content Security Policy directive. The browser behaves differently in such case, the `noscript` tags are not rendered as the browser does not consider that JS is disabled, just that it does not have the credential to execute.

There is an issue opened about this: https://github.com/gorhill/uBlock/issues/308

I am not even sure I may want to fix this, because in other cases the fact that the `noscript` tags are not rendered has beneficial side effects. For example, blocking wholesale inline script on `bild.de` will not cause the site to fallback on its warning asking the user to enable JS.
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: [Ext] uBlock Origin

Post by Brummelchen »

so no filtering inline scripts by content instead policy?
gorhill
Posts: 163
Joined: February 10th, 2015, 8:00 am

Re: [Ext] uBlock Origin

Post by gorhill »

Brummelchen wrote:so no filtering inline scripts by content instead policy?
I don't understand the question.

Block ALL inline script tags on example.com:

Code: Select all

||example.com^$inline-script
Block SPECIFIC inline script tags on example.com, conditional to their text content:

Code: Select all

example.com##script:contains(...)
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: [Ext] uBlock Origin

Post by Brummelchen »

last seems not working on hackintosh.zone

Code: Select all

<!-- script und hop --><script>
        // Function called if AdBlock is not detected
function adBlockNotDetected() {
    console.log('AdBlock is not enabled');
}
// Function called if AdBlock is detected
function adBlockDetected() {
    console.log('AdBlock is enabled');
}

// Recommended audit because AdBlock lock the file 'blockadblock.js' 
// If the file is not called, the variable does not exist 'blockAdBlock'
// This means that AdBlock is present
if(typeof blockAdBlock === 'undefined') {
    adBlockDetected();
} else {
    blockAdBlock.onDetected(adBlockDetected);
    blockAdBlock.onNotDetected(adBlockNotDetected);
    // and|or
    blockAdBlock.on(true, adBlockDetected);
    blockAdBlock.on(false, adBlockNotDetected);
    // and|or
    blockAdBlock.on(true, adBlockDetected).onNotDetected(adBlockNotDetected);
}

// Change the options
blockAdBlock.setOption('checkOnLoad', false);
// and|or
blockAdBlock.setOption({
    debug: true,
    checkOnLoad: false,
    resetOnEnd: false
});
  </script><script>
      $(document).ready(function() {
	setTimeout(function(){
		$('body').addClass('loaded');
	}, 2000);
	
});</script>

Code: Select all

<script type="text/javascript">
function tpdchixamo(){
document.write("<!DOCTYPE html><html><head></head><body><div align='cent"
 +"er'><b><img style='max-width:100%;' src='http://f.cl.ly/items/3F0t2c0L"
 +"360t1A1l0A2W/disable-adblock.png'><br><a href='.'>[ Try again ]</a></b"
 +"><br><strong>If it doesn't work disable ADBlock completely, Click Try "
 +"Again, Enable ADBlock, Add This website to Exceptional List</strong><b"
 +"r><div align='center' id='3727f6ecab' class='pagefair-acceptable'></di"
 +"v></div></body></html>");
   window.history.pushState("object or string", "Hackintosh Zone", "/donate.html");
}
</script><script>
window.onload = function(){
setTimeout(function() {
var ad = document.querySelector("ins.adsbygoogle");
if (ad && ad.innerHTML.replace(/\s/g, "").length == 0) {
tpdchixamo();
}
}, 3000); 
};

</script><script>

 window.onload = function(){
    // This will take care of asynchronous Google ads
    setTimeout(function() {
var clientHeight = document.getElementById('ikherjtpod').clientHeight;

 if(typeof clientHeight === 'undefined'){
   tpdchixamo();
   console.log("ad blocker installed1");
 };


 if(clientHeight == '0'){
console.log("ad blocker installed3");
   tpdchixamo();
 };

 }, 5000); 
    };
</script>
this is what i found out this minute.
the first script name changes on load -> tpdchixamo(); vbqzocephl(); aso.

is that working now?
www.hackintosh.zone##script:contains(ad blocker installed)
www.hackintosh.zone##script:contains(ins.adsbygoogle)
www.hackintosh.zone##script:contains(disable-adblock.png)
i dont get the notice (redirect) again, but the script code is still present.
what about a general filter? or ist it only possible to create such filters site specific?


another one - its those newsletter popup
http://prospekt.real.de/wochenangebote-nach-kategorien/elektrogeraete/unterhaltungselektronik.html
some script sets a cookie "hideteaser" (value=1) if closed
but i did not manage it to filter the script behind.

not working, maybe because "prospekt.real.de prospekt.real.de * allow", otherwise i get a blank site with no content.
prospekt.real.de###overlay-background
prospekt.real.de###newsletter_anmeldung
working (with stylish)
@-moz-document domain("prospekt.real.de") {

#overlay-background, #newsletter_anmeldung
{display: none !important;}
}
scripts allowed in uMatrix, scripts disabled completely in uBlock, no change.
scripts blocked in uMatrix -> website broken.

when i try to create a rule from the log
||prospekt.real.de/typo3temp/compressor$script,domain=prospekt.real.de,important
it does not work. i am really out of clues.
gorhill
Posts: 163
Joined: February 10th, 2015, 8:00 am

Re: [Ext] uBlock Origin

Post by gorhill »

Brummelchen wrote:but the script code is still present.
Inline script tag filters do not cause the script tag to be removed from the DOM, only that the execution of their javascript content is blocked.
Brummelchen wrote:what about a general filter? or ist it only possible to create such filters site specific?
Generic inline script tag filters not supported -- this would be inefficient.
Brummelchen wrote:not working
Inline script tag filtering has been working pretty well -- so I think the first suspicion should be that it's not the proper inline script tag(s) which has been filtered. This may be challenging sometimes to find the right filter. I plan to add to the documentation to give hints about this. For example, using the source of the page is better than using the inspector when looking up which script tag should be filtered.

It's easier for me to be given a URL and to tell me exactly what behavior on the page you want to modify. Is it the popup overlay when first visiting the site?
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: [Ext] uBlock Origin

Post by Brummelchen »

uri from above
its the round newsletter popup with the opaque overlay (see stylish).
it is not shown when a special cookie is set.

not sure, when to use site code or inspector. with inspector i can follow the scripts easily, site code when comparing filters or searching files.

thx for explanation
Post Reply