-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcookieaccept
More file actions
102 lines (85 loc) · 3.34 KB
/
cookieaccept
File metadata and controls
102 lines (85 loc) · 3.34 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// ==UserScript==
// @name Get rid of IAR Cookie Banner
// @description Get rid of IAR Cookie Banner (used for kiosks)
// @license http://creativecommons.org/licenses/by-nc-sa/3.0/
// @downloadURL Adapted from https://gist.githubusercontent.com/BlaM/6d826d6e9d77d2d77bf9a92fdad55788/raw/cookiebanner-go-away.user.js
// @homepageURL Adapted from https://gist.github.com/BlaM/6d826d6e9d77d2d77bf9a92fdad55788
// @version 0.1
// @author Jesse Brennan
// @match https://*.iamresponding.com/*
// @grant none
// @run-at document-idle
// ==/UserScript==
(function() {
'use strict';
var config = {
selectors: {
rules: [
//IAmResponding Cookie Accept
{hostname: /./, action: "click", target: '#rcc-confirm-button'},
],
}
};
function doClick(node, selector) {
var didSomething = false;
for (var i = 0; i < node.length; i++) {
if (!node[i].dataset.cookieAwayClicked) {
node[i].click();
node[i].dataset.cookieAwayClicked = true;
didSomething = true;
}
}
if (didSomething) {
console.log('click', selector);
}
}
function doRule(rule) {
if (typeof rule.hostname == 'string' && rule.hostname !== location.hostname) { return; }
if (typeof rule.hostname == 'object' && typeof rule.hostname.match == 'function' && !rule.hostname.match(location.hostname)) { return; }
if (rule.action == 'remove') { doRemove($$(rule.target), rule.target); }
if (rule.action == 'click') { doClick($$(rule.target), rule.target); }
}
var $$ = function(s) {
return document.querySelectorAll(s);
};
function getObject(key, defValue) {
var obj = window, keys;
try {
keys = key.split('.');
for (var i = 0; i < keys.length; i++) {
obj = obj[keys[i]];
}
} catch(e) {
obj = defValue || null;
}
return typeof obj !== 'undefined'? obj : defValue;
};
function firstCall() {
typeof getObject('Cookiebot.dialog.submitConsent') == 'function' && window.Cookiebot.dialog.submitConsent();
typeof window.hideCookieHint == 'function' && window.hideCookieHint(true);
typeof window.golemAcceptCookies == 'function' && window.golemAcceptCookies();
typeof window.CookiesOK == 'function' && window.CookiesOK();
typeof getObject('CookieControl.notifyAccept') == 'function' && window.CookieControl.notifyAccept();
}
function delayCall1() {
config.selectors.rules = config.selectors.rules.concat(config.selectors.rulesdelay);
}
function delayCall2() {
}
function delayCall5() {
typeof window.__cmpui == 'function' && window.__cmpui("setAndSaveAllConsent",!0); // SourceForge
config.selectors.rules = config.selectors.rules.concat(config.selectors.rulesdelay);
}
function execute() {
config.selectors.rules.forEach(doRule);
}
setTimeout(firstCall, 100);
setTimeout(execute, 150);
setTimeout(execute, 500);
setTimeout(delayCall1, 1100);
setTimeout(execute, 2000);
setTimeout(delayCall2, 2100);
setTimeout(execute, 5000);
setTimeout(delayCall5, 5100);
setTimeout(execute, 10000);
})();