-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontent.js
More file actions
55 lines (47 loc) · 1.4 KB
/
Copy pathcontent.js
File metadata and controls
55 lines (47 loc) · 1.4 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
// Remove AI Overview immediately and continuously
function removeAIOverview() {
const selectors = [
'[data-mcpr]',
'.YzCcne',
'[data-async-type="folsrch"]',
'[jscontroller="EYwa3d"]',
'[data-al="Search Labs"]',
'[data-al="AI overview"]',
'.q8sySb', // AI Overview header
'.hdzaWe' // AI Overview container
];
let removed = 0;
selectors.forEach(selector => {
const elements = document.querySelectorAll(selector);
elements.forEach(element => {
element.remove();
removed++;
});
});
if (removed > 0) {
console.log(`AI Overview Remover: Removed ${removed} elements`);
}
}
// Run immediately
removeAIOverview();
// Run when DOM is ready
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', removeAIOverview);
} else {
removeAIOverview();
}
// Run when window loads
window.addEventListener('load', removeAIOverview);
// Aggressive observer for dynamic content
const observer = new MutationObserver(() => {
removeAIOverview();
});
// Start observing as soon as possible
observer.observe(document.documentElement, {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ['data-mcpr', 'class', 'data-async-type']
});
// Periodic check for stubborn elements
setInterval(removeAIOverview, 500);