Skip to content

Commit

Permalink
Merge pull request dhowe#2313 from mneunomne/dhowe#2311
Browse files Browse the repository at this point in the history
  • Loading branch information
dhowe authored Mar 7, 2023
2 parents 0531582 + 483c246 commit f51565b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/js/adn/adn-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ import { i18n$ } from '../i18n.js';

/**************************** exports *********************************/

// targets on these domains are never internal (may need to be regex)
export const internalLinkDomainsDefault = ['google.com', 'asiaxpat.com', 'nytimes.com',
'columbiagreenemedia.com', '163.com', 'sohu.com', 'zol.com.cn', 'baidu.com',
'yahoo.com', 'facebook.com', 'youtube.com', 'flashback.org'
];

export const makeCloneable = function (notes) {
notes && notes.forEach(function (n) { delete n.func }); // remove func to allow clone
// see https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
Expand Down
8 changes: 1 addition & 7 deletions src/js/adn/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,6 @@ const adnauseam = (function () {

const removableBlockLists = ['hphosts', 'mvps-0', 'plowe-0'];

// targets on these domains are never internal (may need to be regex)
const internalLinkDomains = ['google.com', 'asiaxpat.com', 'nytimes.com',
'columbiagreenemedia.com', '163.com', 'sohu.com', 'zol.com.cn', 'baidu.com',
'yahoo.com', 'youtube.com', 'flashback.org', 'bing.com'
];

// mark ad visits as failure if any of these are included in title
const errorStrings = ['file not found', 'website is currently unavailable', 'not found on this server'];

Expand Down Expand Up @@ -1725,7 +1719,7 @@ const adnauseam = (function () {

if (!validate(ad)) return warn(ad);

if (!internalLinkDomains.contains(ad.pageDomain) && internalTarget(ad)) {
if (!µb.hiddenSettings.internalLinkDomains.includes(ad.pageDomain) && internalTarget(ad)) {
return warn('[INTERN] Ignoring Ad on ' + ad.pageDomain + ', target: ' + ad.targetUrl);
}

Expand Down
5 changes: 4 additions & 1 deletion src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import {
originFromURI,
} from './uri-utils.js';

import { internalLinkDomainsDefault } from './adn/adn-utils.js'; // adn

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

// Not all platforms may have properly declared vAPI.webextFlavor.
Expand Down Expand Up @@ -87,7 +89,8 @@ const hiddenSettingsDefault = {
updateAssetBypassBrowserCache: false,
userResourcesLocation: 'unset',
showAdsDebug: false, // Adn set "true" to show ads that can be potentially be collected #2136
costPerClick: 1.03 // Adn https://github.com/dhowe/AdNauseam/issues/2131
costPerClick: 1.03, // Adn https://github.com/dhowe/AdNauseam/issues/2131
internalLinkDomains: internalLinkDomainsDefault.join(','), // Adn
};

const userSettingsDefault = {
Expand Down
2 changes: 2 additions & 0 deletions src/js/contentscript-extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,11 @@ class ProceduralFilterer {
/* ADN parse procedural selector hits */
if ( nodes.length > 0) {
console.log("[ADN] parse procedural selector hits", nodes)
/*
for ( const node of nodes ) {
vAPI.adCheck && vAPI.adCheck(node);
}
*/
}
/* end ADN */
const t1 = Date.now();
Expand Down

0 comments on commit f51565b

Please sign in to comment.