code: 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 /* '.' */;
      }
docs: The idea is to minimize the amout of work done to figure out whether the resource is 3rd-party to the top document.