A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/gorhill/uBlock/commit/f876b68171ff307f27601225607a6801f400437d below:

Add support for removal of response headers · gorhill/uBlock@f876b68 · GitHub

29 29 30 30

/******************************************************************************/

31 31 32 +

// TODO: fix the inconsistencies re. realm vs. filter source which have

33 +

// accumulated over time.

34 + 32 35

const messaging = vAPI.messaging;

33 36

const logger = self.logger = { ownerId: Date.now() };

34 37

const logDate = new Date();

@@ -341,6 +344,11 @@ const processLoggerEntries = function(response) {

341 344

/******************************************************************************/

342 345 343 346

const parseLogEntry = function(details) {

347 +

// Patch realm until changed all over codebase to make this unecessary

348 +

if ( details.realm === 'cosmetic' ) {

349 +

details.realm = 'extended';

350 +

}

351 + 344 352

const entry = new LogEntry(details);

345 353 346 354

// Assemble the text content, i.e. the pre-built string which will be

@@ -441,6 +449,8 @@ const viewPort = (( ) => {

441 449

const vwLogEntryTemplate = document.querySelector('#logEntryTemplate > div');

442 450

const vwEntries = [];

443 451 452 +

const detailableRealms = new Set([ 'network', 'extended' ]);

453 + 444 454

let vwHeight = 0;

445 455

let lineHeight = 0;

446 456

let wholeHeight = 0;

@@ -672,7 +682,7 @@ const viewPort = (( ) => {

672 682

return div;

673 683

}

674 684 675 -

if ( details.realm === 'network' || details.realm === 'cosmetic' ) {

685 +

if ( detailableRealms.has(details.realm) ) {

676 686

divcl.add('canDetails');

677 687

}

678 688

@@ -685,13 +695,13 @@ const viewPort = (( ) => {

685 695

}

686 696

if ( filteringType === 'static' ) {

687 697

divcl.add('canLookup');

688 -

if ( filter.modifier === true ) {

689 -

div.setAttribute('data-modifier', '');

690 -

}

691 -

} else if ( filteringType === 'cosmetic' ) {

698 +

} else if ( details.realm === 'extended' ) {

692 699

divcl.add('canLookup');

693 700

divcl.toggle('isException', filter.raw.startsWith('#@#'));

694 701

}

702 +

if ( filter.modifier === true ) {

703 +

div.setAttribute('data-modifier', '');

704 +

}

695 705

}

696 706

span = div.children[1];

697 707

if ( renderFilterToSpan(span, cells[1]) === false ) {

@@ -1575,15 +1585,15 @@ const reloadTab = function(ev) {

1575 1585

rawFilter: rawFilter,

1576 1586

});

1577 1587

handleResponse(response);

1578 -

} else if ( targetRow.classList.contains('cosmeticRealm') ) {

1588 +

} else if ( targetRow.classList.contains('extendedRealm') ) {

1579 1589

const response = await messaging.send('loggerUI', {

1580 1590

what: 'listsFromCosmeticFilter',

1581 1591

url: targetRow.children[6].textContent,

1582 1592

rawFilter: rawFilter,

1583 1593

});

1584 1594

handleResponse(response);

1585 1595

}

1586 -

} ;

1596 +

};

1587 1597 1588 1598

const fillSummaryPane = function() {

1589 1599

const rows = dialog.querySelectorAll('.pane.details > div');

@@ -1595,7 +1605,7 @@ const reloadTab = function(ev) {

1595 1605

text = filterFromTargetRow();

1596 1606

if (

1597 1607

(text !== '') &&

1598 -

(trcl.contains('cosmeticRealm') || trcl.contains('networkRealm'))

1608 +

(trcl.contains('extendedRealm') || trcl.contains('networkRealm'))

1599 1609

) {

1600 1610

toSummaryPaneFilterNode(rows[0], text);

1601 1611

} else {

@@ -1607,7 +1617,7 @@ const reloadTab = function(ev) {

1607 1617

(

1608 1618

trcl.contains('dynamicHost') ||

1609 1619

trcl.contains('dynamicUrl') ||

1610 -

trcl.contains('switch')

1620 +

trcl.contains('switchRealm')

1611 1621

)

1612 1622

) {

1613 1623

rows[2].children[1].textContent = text;

@@ -1677,7 +1687,9 @@ const reloadTab = function(ev) {

1677 1687 1678 1688

// Fill dynamic URL filtering pane

1679 1689

const fillDynamicPane = function() {

1680 -

if ( targetRow.classList.contains('cosmeticRealm') ) { return; }

1690 +

if ( targetRow.classList.contains('extendedRealm') ) {

1691 +

return;

1692 +

}

1681 1693 1682 1694

// https://github.com/uBlockOrigin/uBlock-issues/issues/662#issuecomment-509220702

1683 1695

if ( targetType === 'doc' ) { return; }

@@ -1712,8 +1724,6 @@ const reloadTab = function(ev) {

1712 1724

}

1713 1725 1714 1726

colorize();

1715 - 1716 -

uDom('#modalOverlayContainer [data-pane="dynamic"]').removeClass('hide');

1717 1727

};

1718 1728 1719 1729

const fillOriginSelect = function(select, hostname, domain) {

@@ -1733,7 +1743,9 @@ const reloadTab = function(ev) {

1733 1743 1734 1744

// Fill static filtering pane

1735 1745

const fillStaticPane = function() {

1736 -

if ( targetRow.classList.contains('cosmeticRealm') ) { return; }

1746 +

if ( targetRow.classList.contains('extendedRealm') ) {

1747 +

return;

1748 +

}

1737 1749 1738 1750

const template = vAPI.i18n('loggerStaticFilteringSentence');

1739 1751

const rePlaceholder = /\{\{[^}]+?\}\}/g;

@@ -1842,8 +1854,8 @@ const reloadTab = function(ev) {

1842 1854

}

1843 1855

);

1844 1856

dialog.classList.toggle(

1845 -

'cosmeticRealm',

1846 -

targetRow.classList.contains('cosmeticRealm')

1857 +

'extendedRealm',

1858 +

targetRow.classList.contains('extendedRealm')

1847 1859

);

1848 1860

targetDomain = domains[0];

1849 1861

targetPageDomain = domains[1];

@@ -2403,10 +2415,10 @@ const popupManager = (( ) => {

2403 2415

// Filter hit stats' MVP ("minimum viable product")

2404 2416

//

2405 2417

const loggerStats = (( ) => {

2418 +

const enabled = false;

2406 2419

const filterHits = new Map();

2407 2420

let dialog;

2408 2421

let timer;

2409 - 2410 2422

const makeRow = function() {

2411 2423

const div = document.createElement('div');

2412 2424

div.appendChild(document.createElement('span'));

@@ -2470,6 +2482,7 @@ const loggerStats = (( ) => {

2470 2482 2471 2483

return {

2472 2484

processFilter: function(filter) {

2485 +

if ( enabled !== true ) { return; }

2473 2486

if ( filter.source !== 'static' && filter.source !== 'cosmetic' ) {

2474 2487

return;

2475 2488

}


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4