-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_current_frame.js
More file actions
44 lines (42 loc) · 1.44 KB
/
Copy pathcheck_current_frame.js
File metadata and controls
44 lines (42 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
This content script is injected in every frame present on the current web page.
If the source URL of the frame contains to one of the stings in trackers as substring,
the frame is identified as belonging to a chosen tracking service. Then the usage
statistics are communicated to the background script (see background.js).
*/
trackers = [
'doubleclick',
'google-analytics',
'googlesyndication',
'googleadservices',
'scorecardresearch',
'imrworldwide',
'adnxs',
'criteo',
'rubiconproject',
'serving-sys',
'adform',
'googletagservices',
'googletagmanager',
'pubmatic',
'ads.yahoo',
'addthis',
'turn.com',
'bluekai',
'mathtag',
'adadvisor',
];
for(t in trackers) {
if (document.domain.indexOf(trackers[t]) != -1) {
var localStorageUsed = localStorage.key(0) != null;
chrome.runtime.sendMessage({type: 'tracker', tracker: document.domain, localStorageUsed: localStorageUsed, indexedDBUsed: false}, function(resp){
//alert(resp); //DEBUG LINE
});
indexedDB.webkitGetDatabaseNames().onsuccess = function(sender,args) {
var indexedDBUsed = sender.target.result.length > 0;
chrome.runtime.sendMessage({type: 'tracker', tracker: document.domain, localStorageUsed: false, indexedDBUsed: indexedDBUsed}, function(resp){
//alert(resp); // DEBUG LINE
});
};
}
}