A RetroSearch Logo

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

Search Query:

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

Add support for AdGuard's `mp4` filter option · gorhill/uBlock@68ae847 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+12

-7

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+12

-7

lines changed Original file line number Diff line number Diff line change

@@ -273,7 +273,6 @@ const RedirectEngine = function() {

273 273 274 274

RedirectEngine.prototype.reset = function() {

275 275

this.rules = new Map();

276 -

this.ruleTypes = new Set();

277 276

this.ruleSources = new Set();

278 277

this.ruleDestinations = new Set();

279 278

this.modifyTime = Date.now();

@@ -384,7 +383,6 @@ RedirectEngine.prototype.toURL = function(fctxt) {

384 383

RedirectEngine.prototype.addRule = function(src, des, type, pattern, redirect) {

385 384

this.ruleSources.add(src);

386 385

this.ruleDestinations.add(des);

387 -

this.ruleTypes.add(type);

388 386

const key = `${src} ${des} ${type}`,

389 387

entries = this.rules.get(key);

390 388

if ( entries === undefined ) {

@@ -475,6 +473,10 @@ RedirectEngine.prototype.compileRuleFromStaticFilter = function(line) {

475 473

redirect = 'empty';

476 474

continue;

477 475

}

476 +

if ( option === 'mp4' ) {

477 +

redirect = 'noopmp4-1s';

478 +

continue;

479 +

}

478 480

if ( option.startsWith('domain=') ) {

479 481

srchns = option.slice(7).split('|');

480 482

continue;

@@ -496,8 +498,13 @@ RedirectEngine.prototype.compileRuleFromStaticFilter = function(line) {

496 498 497 499

// Need one single type -- not negated.

498 500

if ( type === undefined ) {

499 -

if ( redirect !== 'empty' ) { return; }

500 -

type = '*';

501 +

if ( redirect === 'empty' ) {

502 +

type = '*';

503 +

} else if ( redirect === 'noopmp4-1s' ) {

504 +

type = 'media';

505 +

} else {

506 +

return;

507 +

}

501 508

}

502 509 503 510

if ( deshn === '' ) {

@@ -562,7 +569,6 @@ RedirectEngine.prototype.toSelfie = function(path) {

562 569

`${path}/main`,

563 570

JSON.stringify({

564 571

rules: rules,

565 -

ruleTypes: Array.from(this.ruleTypes),

566 572

ruleSources: Array.from(this.ruleSources),

567 573

ruleDestinations: Array.from(this.ruleDestinations)

568 574

})

@@ -580,7 +586,6 @@ RedirectEngine.prototype.fromSelfie = function(path) {

580 586

}

581 587

if ( selfie instanceof Object === false ) { return false; }

582 588

this.rules = new Map(selfie.rules);

583 -

this.ruleTypes = new Set(selfie.ruleTypes);

584 589

this.ruleSources = new Set(selfie.ruleSources);

585 590

this.ruleDestinations = new Set(selfie.ruleDestinations);

586 591

this.modifyTime = Date.now();

Original file line number Diff line number Diff line change

@@ -2011,7 +2011,7 @@ FilterParser.prototype.parseOptions = function(s) {

2011 2011

continue;

2012 2012

}

2013 2013

// Used by Adguard, purpose is unclear -- just ignore for now.

2014 -

if ( opt === 'empty' ) {

2014 +

if ( opt === 'empty' || opt === 'mp4' ) {

2015 2015

if ( this.redirect !== 0 ) {

2016 2016

this.unsupported = true;

2017 2017

break;

You can’t perform that action at this time.


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