bench/comparison/blockers/ublock/filtering-context.js
function() {
        let tabDomain = this.getTabDomain();
        if ( tabDomain === '' ) { tabDomain = this.tabHostname; }
        if ( this.domain !== undefined && this.domain !== '' ) {
            return this.domain !== tabDomain;
        }
        const hostname = this.getHostname();
        if ( hostname.endsWith(tabDomain) === false ) { return true; }
        const i = hostname.length - tabDomain.length;
        if ( i === 0 ) { return false; }
        return hostname.charCodeAt(i - 1) !== 0x2E /* '.' */;
    }
function() {
        let tabDomain = this.getTabDomain();
        if ( tabDomain === '' ) { tabDomain = this.tabHostname; }
        if ( this.domain !== undefined && this.domain !== '' ) {
            return this.domain !== tabDomain;
        }
        const hostname = this.getHostname();
        if ( hostname.endsWith(tabDomain) === false ) { return true; }
        const i = hostname.length - tabDomain.length;
        if ( i === 0 ) { return false; }
        return hostname.charCodeAt(i - 1) !== 0x2E /* '.' */;
    }
function ( ) { let tabDomain = this . getTabDomain ( ) ; if ( tabDomain === '' ) { tabDomain = this . tabHostname ; } if ( this . domain !== undefined && this . domain !== '' ) { return this . domain !== tabDomain ; } const hostname = this . getHostname ( ) ; if ( hostname . endsWith ( tabDomain ) === false ) { return true ; } const i = hostname . length - tabDomain . length ; if ( i === 0 ) { return false ; } return hostname . charCodeAt ( i - 1 ) !== 0x2E /* '.' */ ; }
The idea is to minimize the amout of work done to figure out whether the resource is 3rd-party to the top document.
The idea is to minimize the amout of work done to figure out whether the resource is 3rd - party to the top document .