File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { getGlobal } from './utils.js' ;
2
+
1
3
/**
2
4
* Check if the current document origin is on the tracker list, using the provided lookup trie.
3
5
* @param {object } trackerLookup Trie lookup of tracker domains
4
6
* @returns {boolean } True iff the origin is a tracker.
5
7
*/
6
- export function isTrackerOrigin ( trackerLookup , originHostname = document . location . hostname ) {
8
+ export function isTrackerOrigin ( trackerLookup , originHostname = getGlobal ( ) . document . location . hostname ) {
7
9
const parts = originHostname . split ( '.' ) . reverse ( ) ;
8
10
let node = trackerLookup ;
9
11
for ( const sub of parts ) {
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ export function setGlobal(globalObjIn) {
49
49
Error = globalObj . Error ;
50
50
}
51
51
52
+ export function getGlobal ( ) {
53
+ return globalObj ;
54
+ }
55
+
52
56
// linear feedback shift register to find a random approximation
53
57
export function nextRandom ( v ) {
54
58
return Math . abs ( ( v >> 1 ) | ( ( ( v << 62 ) ^ ( v << 61 ) ) & ( ~ ( ~ 0 << 63 ) << 62 ) ) ) ;
You can’t perform that action at this time.
0 commit comments