This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update seia-soto/asdefuser Co-authored-by: HoJeong Go <[email protected]> * chore: add ad-shield domains * build: update user.js * chore: add thephoblographer.com https://www.thephoblographer.com/2023/12/31/last-chance-to-win-this-great-lens/ https://github.com/ghostery/ghostery-extension/issues/1430 * chore: remove m.inven.co.kr in exclusions list --------- Co-authored-by: HoJeong Go <[email protected]>
- Loading branch information
1 parent
4bccb2f
commit 80390fd
Showing
16 changed files
with
302 additions
and
304 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
type Analyzer = (line: string) => boolean; | ||
|
||
class MemoizedCallAnalyzer { | ||
private readonly cache: Map<string, boolean>; | ||
private readonly analyzer: Analyzer; | ||
|
||
constructor(analyzer: Analyzer) { | ||
this.cache = new Map(); | ||
this.analyzer = analyzer; | ||
} | ||
|
||
analyze(line: string) { | ||
if (this.cache.has(line)) { | ||
return this.cache.get(line)!; | ||
} | ||
|
||
const result = this.analyzer(line); | ||
|
||
this.cache.set(line, result); | ||
|
||
return result; | ||
} | ||
} | ||
|
||
export const annoymousCallAnalyzer = new MemoizedCallAnalyzer(line => line.startsWith('[') || line.startsWith('<')); | ||
|
||
export const extensionCallAnalyzer = new MemoizedCallAnalyzer(line => line.startsWith('chrome') || line.startsWith('webkit') || line.startsWith('moz')); | ||
|
||
const knownAdShieldOrigins = [ | ||
'https://07c225f3.online', | ||
'https://css-load.com', | ||
'https://html-load', | ||
'https://content-loader.com', | ||
]; | ||
|
||
export const adShieldCallAnalyzer = new MemoizedCallAnalyzer(line => { | ||
if (line.endsWith('/script.min.js') || line.endsWith('/loader.min.js')) { | ||
return true; | ||
} | ||
|
||
if (!location.origin.endsWith('.online') && line.includes('.online')) { | ||
return true; | ||
} | ||
|
||
for (const origin of knownAdShieldOrigins) { | ||
if (line.startsWith(origin)) { | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {type getCallStack} from '../utils'; | ||
import {adShieldCallAnalyzer} from './analyzers'; | ||
|
||
export type ValidatorFunction = (callStack: ReturnType<typeof getCallStack>) => boolean; | ||
|
||
export const hasOriginOfAdShield: ValidatorFunction = ({trace}) => adShieldCallAnalyzer.analyze(trace[trace.length - 1]); | ||
|
||
export const hasAdShield: ValidatorFunction = ({trace}) => { | ||
for (const line of trace) { | ||
if (adShieldCallAnalyzer.analyze(line)) { | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
}; | ||
|
||
export const createValidationSuite = (validators: ValidatorFunction[]) => (callStack: ReturnType<typeof getCallStack>) => { | ||
for (const validator of validators) { | ||
if (validator(callStack)) { | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
}; | ||
|
||
export const adShieldOriginCheck = createValidationSuite([hasOriginOfAdShield]); | ||
|
||
export const adShieldStrictCheck = createValidationSuite([hasAdShield]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.