mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-20 21:14:10 +02:00
this fixes #423
This commit is contained in:
parent
35db700f58
commit
6fc7f96a48
3 changed files with 14 additions and 5 deletions
|
@ -42,6 +42,11 @@ var messager = vAPI.messaging.channel('contentscript-end.js');
|
||||||
// ABP cosmetic filters
|
// ABP cosmetic filters
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
if ( vAPI.skipCosmeticFiltering ) {
|
||||||
|
// console.debug('Abort cosmetic filtering');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var queriedSelectors = {};
|
var queriedSelectors = {};
|
||||||
var injectedSelectors = vAPI.hideCosmeticFilters || {};
|
var injectedSelectors = vAPI.hideCosmeticFilters || {};
|
||||||
var classSelectors = null;
|
var classSelectors = null;
|
||||||
|
|
|
@ -34,11 +34,16 @@
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
// because Safari
|
// Because Safari
|
||||||
if ( vAPI.canExecuteContentScript() !== true ) {
|
if ( vAPI.canExecuteContentScript() !== true ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Because in case
|
||||||
|
if ( !vAPI ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
var localMessager = vAPI.messaging.channel('contentscript-start.js');
|
var localMessager = vAPI.messaging.channel('contentscript-start.js');
|
||||||
|
@ -116,6 +121,7 @@ var netFilters = function(details) {
|
||||||
};
|
};
|
||||||
|
|
||||||
var filteringHandler = function(details) {
|
var filteringHandler = function(details) {
|
||||||
|
vAPI.skipCosmeticFiltering = !details || details.skipCosmeticFiltering;
|
||||||
if ( details ) {
|
if ( details ) {
|
||||||
if ( details.cosmeticHide.length !== 0 || details.cosmeticDonthide.length !== 0 ) {
|
if ( details.cosmeticHide.length !== 0 || details.cosmeticDonthide.length !== 0 ) {
|
||||||
cosmeticFilters(details);
|
cosmeticFilters(details);
|
||||||
|
|
|
@ -969,7 +969,7 @@ FilterContainer.prototype.pruneSelectorCache = function() {
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
FilterContainer.prototype.retrieveGenericSelectors = function(request) {
|
FilterContainer.prototype.retrieveGenericSelectors = function(request) {
|
||||||
if ( µb.userSettings.parseAllABPHideFilters !== true ) {
|
if ( this.acceptedCount !== 0 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( !request.selectors ) {
|
if ( !request.selectors ) {
|
||||||
|
@ -1031,9 +1031,6 @@ FilterContainer.prototype.retrieveGenericSelectors = function(request) {
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
FilterContainer.prototype.retrieveDomainSelectors = function(request) {
|
FilterContainer.prototype.retrieveDomainSelectors = function(request) {
|
||||||
if ( µb.userSettings.parseAllABPHideFilters !== true ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ( !request.locationURL ) {
|
if ( !request.locationURL ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1047,6 +1044,7 @@ FilterContainer.prototype.retrieveDomainSelectors = function(request) {
|
||||||
var r = {
|
var r = {
|
||||||
domain: domain,
|
domain: domain,
|
||||||
entity: pos === -1 ? domain : domain.slice(0, pos - domain.length),
|
entity: pos === -1 ? domain : domain.slice(0, pos - domain.length),
|
||||||
|
skipCosmeticFiltering: this.acceptedCount === 0,
|
||||||
cosmeticHide: [],
|
cosmeticHide: [],
|
||||||
cosmeticDonthide: [],
|
cosmeticDonthide: [],
|
||||||
netHide: [],
|
netHide: [],
|
||||||
|
|
Loading…
Reference in a new issue