Skip to content

Commit

Permalink
Merge pull request #44 from MarcellPerger1/fix-geeksforgeeks
Browse files Browse the repository at this point in the history
Fix not blocking side video on geeksforgeeks
  • Loading branch information
MarcellPerger1 authored May 29, 2024
2 parents 83dca4f + 8ccc03a commit 235f665
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/debug/adblocker.debug.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/debug/bookmarklet.debug.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/release/adblocker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/release/bookmarklet.min.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/adblocker.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@
/** @type {{selector: string?, func: (elem: Element) => any}[]} */
func: [
{
selector: '[class*="ad"],[id*="ad"]',
selector: '[class*="ad" i],[id*="ad" i]',
/** This is the one that gets most of them, rest is just special cases */
func(elem) {
for (const name of [elem.id, ...elem.classList]) {
// TODO also check lowercase followed by uppercase at end e.g. adBox
if(/(?<!lo|re|he)[aA]d(vertisement)?s?([tT]hrive)?([cC]ontent)?([eE]ngine|[nN]gin)?([cC]ontainer)?s?($|[-_,\s])/.test(name)) {
if(/(?<!lo|re|he)(ad|Ad|AD)(vertisement)?s?([tT]hrive)?([cC]ontent)?([eE]ngine|[nN]gin)?([cC]ontainer)?s?($|[-_,\s])/.test(name)) {
return true;
}
}
Expand Down

0 comments on commit 235f665

Please sign in to comment.