AnesKAM commited on
Commit
7231861
ยท
verified ยท
1 Parent(s): df422cc

Update results.html

Browse files
Files changed (1) hide show
  1. results.html +205 -133
results.html CHANGED
@@ -10,10 +10,15 @@
10
  rel="stylesheet" />
11
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" rel="stylesheet" />
12
  <style>
 
 
 
13
  :root {
14
  --bg-base: #f8fafc;
15
  --bg-nav: rgba(255, 255, 255, 0.85);
16
  --bg-card: #ffffff;
 
 
17
  --border: #e2e8f0;
18
  --accent: #6366f1;
19
  --accent-2: #ec4899;
@@ -22,6 +27,20 @@
22
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
23
  }
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  * {
26
  margin: 0;
27
  padding: 0;
@@ -35,6 +54,7 @@
35
  color: var(--text-main);
36
  min-height: 100vh;
37
  overflow-x: hidden;
 
38
  }
39
 
40
  .orb {
@@ -44,6 +64,7 @@
44
  z-index: 0;
45
  pointer-events: none;
46
  opacity: 0.15;
 
47
  }
48
 
49
  .orb-1 {
@@ -83,6 +104,7 @@
83
  z-index: 1000;
84
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
85
  gap: 15px;
 
86
  }
87
 
88
  .brand {
@@ -117,17 +139,17 @@
117
  .search-bar {
118
  display: flex;
119
  align-items: center;
120
- background: #f1f5f9;
121
  border: 1px solid var(--border);
122
  border-radius: 100px;
123
  padding: 4px;
124
- transition: var(--transition);
125
  width: 100%;
126
  }
127
 
128
  .search-bar:focus-within {
129
  border-color: var(--accent);
130
- background: #ffffff;
131
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
132
  }
133
 
@@ -145,6 +167,27 @@
145
  color: var(--text-sub);
146
  }
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  .tabs-bar {
149
  position: fixed;
150
  top: 105px;
@@ -225,7 +268,7 @@
225
  .gsc-result:hover {
226
  border-color: var(--accent) !important;
227
  transform: translateX(-5px) !important;
228
- background: #f8fafc !important;
229
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.08) !important;
230
  }
231
 
@@ -408,7 +451,7 @@
408
  }
409
  }
410
 
411
- /* ุชู†ุณูŠู‚ ุงู„ูุงู ุงูŠูƒูˆู† ุงู„ุฌุฏูŠุฏ ูˆุงู„ู…ุญุณู† */
412
  .gs-favicon {
413
  width: 20px;
414
  height: 20px;
@@ -446,7 +489,10 @@
446
  </button>
447
  </form>
448
  </div>
449
- <div class="hidden md:block" style="width: 40px;"></div>
 
 
 
450
  </nav>
451
 
452
  <div class="tabs-bar">
@@ -516,152 +562,178 @@
516
  </div>
517
 
518
  <script>
519
- const ENGINES = {
520
- all: '75aa960081baa4f0c',
521
- news: '35b0f5b6012e94f78',
522
- images: '23c7fd94975714dd8',
523
- videos: 'b11f5dceb04784b9f'
524
- };
525
-
526
- const params = new URLSearchParams(window.location.search);
527
- let query = params.get('q');
528
- let currentTab = params.get('tab') || 'all';
529
- const inputField = document.getElementById('main-input');
530
- const resultsContainer = document.getElementById('results-container');
531
- const loadingText = document.getElementById('loading-text');
532
- const sidebarToggle = document.getElementById('sidebarToggle');
533
- const sidebarContent = document.getElementById('sidebarContent');
534
-
535
- if (sidebarToggle) {
536
- sidebarToggle.addEventListener('click', () => {
537
- sidebarContent.classList.toggle('active');
538
- const icon = sidebarToggle.querySelector('.fa-chevron-down, .fa-chevron-up');
539
- if (sidebarContent.classList.contains('active')) {
540
- icon.classList.remove('fa-chevron-down');
541
- icon.classList.add('fa-chevron-up');
542
  } else {
543
- icon.classList.remove('fa-chevron-up');
544
- icon.classList.add('fa-chevron-down');
545
  }
546
- });
547
- }
548
-
549
- document.querySelectorAll('.tab-pill').forEach(btn => {
550
- btn.classList.toggle('active', btn.dataset.tab === currentTab);
551
- });
552
 
553
- if (query) {
554
- inputField.value = query;
555
- document.title = `${query} - SurfGO`;
556
- loadSurfEngine(currentTab);
557
- } else {
558
- loadingText.textContent = "ูŠุฑุฌู‰ ุฅุฏุฎุงู„ ูƒู„ู…ุฉ ุจุญุซ ู„ู„ุจุฏุก.";
559
- }
560
 
561
- function loadSurfEngine(tab) {
562
- const cx = ENGINES[tab];
563
- resultsContainer.innerHTML = '';
564
- loadingText.style.display = 'block';
565
- document.querySelectorAll('.tab-pill').forEach(btn => {
566
- btn.classList.toggle('active', btn.dataset.tab === tab);
567
  });
568
 
569
- const oldScript = document.getElementById('cse-logic');
570
- if (oldScript) oldScript.remove();
571
-
572
- const script = document.createElement('script');
573
- script.id = 'cse-logic';
574
- script.src = `https://cse.google.com/cse.js?cx=${cx}`;
575
- script.async = true;
576
- script.onload = () => {
577
- const gcseDiv = document.createElement('div');
578
- gcseDiv.className = 'gcse-searchresults-only';
579
- gcseDiv.setAttribute('data-query', query);
580
- resultsContainer.appendChild(gcseDiv);
581
- setTimeout(() => {
582
- loadingText.style.display = 'none';
583
- }, 1000);
584
  };
585
- document.head.appendChild(script);
586
- }
587
-
588
- document.querySelectorAll('.tab-pill').forEach(btn => {
589
- btn.addEventListener('click', () => {
590
- currentTab = btn.dataset.tab;
591
- const newUrl = `${window.location.pathname}?q=${encodeURIComponent(query || '')}&tab=${currentTab}`;
592
- window.history.pushState({ path: newUrl }, '', newUrl);
593
- if (query) loadSurfEngine(currentTab);
594
- else {
595
- document.querySelectorAll('.tab-pill').forEach(b => b.classList.toggle('active', b
596
- .dataset.tab === currentTab));
597
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
598
  });
599
- });
600
 
601
- document.getElementById('search-form').addEventListener('submit', (e) => {
602
- e.preventDefault();
603
- query = inputField.value;
604
  if (query) {
605
- const newUrl = `${window.location.pathname}?q=${encodeURIComponent(query)}&tab=${currentTab}`;
606
- window.history.pushState({ path: newUrl }, '', newUrl);
607
  loadSurfEngine(currentTab);
 
 
608
  }
609
- });
610
-
611
- // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
612
- // ุงู„ู…ุฑุงู‚ุจ ุงู„ุฐูƒูŠ: ุฅุฒุงู„ุฉ ุนู†ุงุตุฑ ุบูˆุบู„ + ุฅุถุงูุฉ ุงู„ูุงู ุงูŠูƒูˆู† ุจุฐูƒุงุก
613
- // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
614
- const observer = new MutationObserver((mutations) => {
615
- // ุฅุฎูุงุก ุนู†ุงุตุฑ ุบูˆุบู„ ุบูŠุฑ ุงู„ู…ุฑุบูˆุจ ููŠู‡ุง
616
- document.querySelectorAll(
617
- '.gsc-adBlock, .gcsc-branding, .gsc-result-info, .gsc-tabsArea, .gsc-refinementHeader'
618
- ).forEach(el => el.remove());
619
-
620
- // ุฅุถุงูุฉ ุดุนุงุฑ ุงู„ู…ูˆู‚ุน (ูุงู ุงูŠูƒูˆู†) ู„ูƒู„ ู†ุชูŠุฌุฉ
621
- document.querySelectorAll('.gsc-result').forEach(result => {
622
- if (result.dataset.faviconAdded) return;
623
-
624
- const link = result.querySelector('a.gs-title');
625
- if (!link) return;
626
-
627
- let domain = '';
628
- try {
629
- if (link.href) {
630
- const url = new URL(link.href);
631
- domain = url.hostname;
632
- }
633
- } catch (e) {
634
- // ู†ุชุฌุงู‡ู„ ุงู„ุฃุฎุทุงุก ูˆู†ุณุชุฎุฏู… ุฃูŠู‚ูˆู†ุฉ ุงูุชุฑุงุถูŠุฉ
635
- }
636
 
637
- const favicon = document.createElement('img');
638
- favicon.className = 'gs-favicon';
639
- favicon.alt = 'ุดุนุงุฑ ุงู„ู…ูˆู‚ุน';
640
- favicon.loading = 'lazy';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
641
 
642
- if (domain) {
643
- favicon.src = `https://www.google.com/s2/favicons?domain=${domain}&sz=32`;
644
- favicon.onerror = () => {
645
- favicon.src =
646
- 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%236366f1"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>';
647
- };
648
- } else {
649
- favicon.src =
650
- 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%236366f1"><circle cx="12" cy="12" r="10"/></svg>';
651
- }
 
 
652
 
653
- // ุฅุฏุฑุงุฌ ุงู„ุฃูŠู‚ูˆู†ุฉ ุฏุงุฎู„ ุงู„ุฑุงุจุท ูƒุฃูˆู„ ุนู†ุตุฑ
654
- if (link.firstChild) {
655
- link.insertBefore(favicon, link.firstChild);
656
- } else {
657
- link.appendChild(favicon);
 
 
658
  }
 
659
 
660
- result.dataset.faviconAdded = 'true';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
661
  });
662
- });
663
 
664
- observer.observe(document.body, { childList: true, subtree: true });
 
665
  </script>
666
  </body>
667
  </html>
 
10
  rel="stylesheet" />
11
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" rel="stylesheet" />
12
  <style>
13
+ /* =========================================
14
+ 1. ู†ุธุงู… ุงู„ุฃู„ูˆุงู† ูˆุงู„ูˆุถุน ุงู„ุฏุงูƒู†
15
+ ========================================= */
16
  :root {
17
  --bg-base: #f8fafc;
18
  --bg-nav: rgba(255, 255, 255, 0.85);
19
  --bg-card: #ffffff;
20
+ --bg-input: #f1f5f9;
21
+ --bg-input-focus: #ffffff;
22
  --border: #e2e8f0;
23
  --accent: #6366f1;
24
  --accent-2: #ec4899;
 
27
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
28
  }
29
 
30
+ /* ุงู„ูˆุถุน ุงู„ุฏุงูƒู† */
31
+ [data-theme="dark"] {
32
+ --bg-base: #0f172a;
33
+ --bg-nav: rgba(15, 23, 42, 0.9);
34
+ --bg-card: #1e293b;
35
+ --bg-input: #334155;
36
+ --bg-input-focus: #1e293b;
37
+ --border: #334155;
38
+ --accent: #818cf8;
39
+ --accent-2: #f472b6;
40
+ --text-main: #f1f5f9;
41
+ --text-sub: #94a3b8;
42
+ }
43
+
44
  * {
45
  margin: 0;
46
  padding: 0;
 
54
  color: var(--text-main);
55
  min-height: 100vh;
56
  overflow-x: hidden;
57
+ transition: background-color 0.3s ease, color 0.3s ease;
58
  }
59
 
60
  .orb {
 
64
  z-index: 0;
65
  pointer-events: none;
66
  opacity: 0.15;
67
+ transition: opacity 0.3s;
68
  }
69
 
70
  .orb-1 {
 
104
  z-index: 1000;
105
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
106
  gap: 15px;
107
+ transition: background 0.3s, border-color 0.3s;
108
  }
109
 
110
  .brand {
 
139
  .search-bar {
140
  display: flex;
141
  align-items: center;
142
+ background: var(--bg-input);
143
  border: 1px solid var(--border);
144
  border-radius: 100px;
145
  padding: 4px;
146
+ transition: var(--transition), background-color 0.3s;
147
  width: 100%;
148
  }
149
 
150
  .search-bar:focus-within {
151
  border-color: var(--accent);
152
+ background: var(--bg-input-focus);
153
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
154
  }
155
 
 
167
  color: var(--text-sub);
168
  }
169
 
170
+ /* ุฒุฑ ุชุจุฏูŠู„ ุงู„ุณู…ุฉ */
171
+ #theme-toggle {
172
+ background: none;
173
+ border: none;
174
+ color: var(--text-main);
175
+ cursor: pointer;
176
+ padding: 5px;
177
+ font-size: 20px;
178
+ width: 40px;
179
+ height: 40px;
180
+ border-radius: 50%;
181
+ display: flex;
182
+ align-items: center;
183
+ justify-content: center;
184
+ transition: background 0.3s, color 0.3s;
185
+ }
186
+
187
+ #theme-toggle:hover {
188
+ background: var(--border);
189
+ }
190
+
191
  .tabs-bar {
192
  position: fixed;
193
  top: 105px;
 
268
  .gsc-result:hover {
269
  border-color: var(--accent) !important;
270
  transform: translateX(-5px) !important;
271
+ background: var(--bg-input) !important;
272
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.08) !important;
273
  }
274
 
 
451
  }
452
  }
453
 
454
+ /* ุฃูŠู‚ูˆู†ุงุช ุงู„ู…ูˆุงู‚ุน */
455
  .gs-favicon {
456
  width: 20px;
457
  height: 20px;
 
489
  </button>
490
  </form>
491
  </div>
492
+ <!-- ุฒุฑ ุชุจุฏูŠู„ ุงู„ูˆุถุน ุงู„ุฏุงูƒู†/ุงู„ูุงุชุญ -->
493
+ <button id="theme-toggle" aria-label="ุชุบูŠูŠุฑ ุงู„ุณู…ุฉ">
494
+ <i class="fa-solid fa-moon"></i>
495
+ </button>
496
  </nav>
497
 
498
  <div class="tabs-bar">
 
562
  </div>
563
 
564
  <script>
565
+ (function() {
566
+ // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
567
+ // ุฅุฏุงุฑุฉ ุงู„ุณู…ุฉ (ุฏุงูƒู†/ูุงุชุญ)
568
+ // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
569
+ const themeToggle = document.getElementById('theme-toggle');
570
+ const themeIcon = themeToggle.querySelector('i');
571
+
572
+ function setTheme(theme) {
573
+ document.documentElement.setAttribute('data-theme', theme);
574
+ localStorage.setItem('surfgo-theme', theme);
575
+ if (theme === 'dark') {
576
+ themeIcon.classList.remove('fa-moon');
577
+ themeIcon.classList.add('fa-sun');
 
 
 
 
 
 
 
 
 
 
578
  } else {
579
+ themeIcon.classList.remove('fa-sun');
580
+ themeIcon.classList.add('fa-moon');
581
  }
582
+ }
 
 
 
 
 
583
 
584
+ // ุงุณุชุนุงุฏุฉ ุงู„ุณู…ุฉ ุงู„ู…ุญููˆุธุฉ ุฃูˆ ุงุณุชุฎุฏุงู… ุงู„ูุงุชุญ ูƒุฅูุชุฑุงุถูŠ
585
+ const savedTheme = localStorage.getItem('surfgo-theme') || 'light';
586
+ setTheme(savedTheme);
 
 
 
 
587
 
588
+ themeToggle.addEventListener('click', () => {
589
+ const current = document.documentElement.getAttribute('data-theme');
590
+ const next = current === 'dark' ? 'light' : 'dark';
591
+ setTheme(next);
 
 
592
  });
593
 
594
+ // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
595
+ // ู…ุญุฑูƒุงุช ุงู„ุจุญุซ ูˆุงู„ุฅุนุฏุงุฏุงุช ุงู„ุฃุฎุฑู‰
596
+ // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
597
+ const ENGINES = {
598
+ all: '75aa960081baa4f0c',
599
+ news: '35b0f5b6012e94f78',
600
+ images: '23c7fd94975714dd8',
601
+ videos: 'b11f5dceb04784b9f'
 
 
 
 
 
 
 
602
  };
603
+
604
+ const params = new URLSearchParams(window.location.search);
605
+ let query = params.get('q');
606
+ let currentTab = params.get('tab') || 'all';
607
+ const inputField = document.getElementById('main-input');
608
+ const resultsContainer = document.getElementById('results-container');
609
+ const loadingText = document.getElementById('loading-text');
610
+ const sidebarToggle = document.getElementById('sidebarToggle');
611
+ const sidebarContent = document.getElementById('sidebarContent');
612
+
613
+ if (sidebarToggle) {
614
+ sidebarToggle.addEventListener('click', () => {
615
+ sidebarContent.classList.toggle('active');
616
+ const icon = sidebarToggle.querySelector('.fa-chevron-down, .fa-chevron-up');
617
+ if (sidebarContent.classList.contains('active')) {
618
+ icon.classList.remove('fa-chevron-down');
619
+ icon.classList.add('fa-chevron-up');
620
+ } else {
621
+ icon.classList.remove('fa-chevron-up');
622
+ icon.classList.add('fa-chevron-down');
623
+ }
624
+ });
625
+ }
626
+
627
+ document.querySelectorAll('.tab-pill').forEach(btn => {
628
+ btn.classList.toggle('active', btn.dataset.tab === currentTab);
629
  });
 
630
 
 
 
 
631
  if (query) {
632
+ inputField.value = query;
633
+ document.title = `${query} - SurfGO`;
634
  loadSurfEngine(currentTab);
635
+ } else {
636
+ loadingText.textContent = "ูŠุฑุฌู‰ ุฅุฏุฎุงู„ ูƒู„ู…ุฉ ุจุญุซ ู„ู„ุจุฏุก.";
637
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
638
 
639
+ function loadSurfEngine(tab) {
640
+ const cx = ENGINES[tab];
641
+ resultsContainer.innerHTML = '';
642
+ loadingText.style.display = 'block';
643
+ document.querySelectorAll('.tab-pill').forEach(btn => {
644
+ btn.classList.toggle('active', btn.dataset.tab === tab);
645
+ });
646
+
647
+ const oldScript = document.getElementById('cse-logic');
648
+ if (oldScript) oldScript.remove();
649
+
650
+ const script = document.createElement('script');
651
+ script.id = 'cse-logic';
652
+ script.src = `https://cse.google.com/cse.js?cx=${cx}`;
653
+ script.async = true;
654
+ script.onload = () => {
655
+ const gcseDiv = document.createElement('div');
656
+ gcseDiv.className = 'gcse-searchresults-only';
657
+ gcseDiv.setAttribute('data-query', query);
658
+ resultsContainer.appendChild(gcseDiv);
659
+ setTimeout(() => {
660
+ loadingText.style.display = 'none';
661
+ }, 1000);
662
+ };
663
+ document.head.appendChild(script);
664
+ }
665
 
666
+ document.querySelectorAll('.tab-pill').forEach(btn => {
667
+ btn.addEventListener('click', () => {
668
+ currentTab = btn.dataset.tab;
669
+ const newUrl = `${window.location.pathname}?q=${encodeURIComponent(query || '')}&tab=${currentTab}`;
670
+ window.history.pushState({ path: newUrl }, '', newUrl);
671
+ if (query) loadSurfEngine(currentTab);
672
+ else {
673
+ document.querySelectorAll('.tab-pill').forEach(b => b.classList.toggle('active', b.dataset
674
+ .tab === currentTab));
675
+ }
676
+ });
677
+ });
678
 
679
+ document.getElementById('search-form').addEventListener('submit', (e) => {
680
+ e.preventDefault();
681
+ query = inputField.value;
682
+ if (query) {
683
+ const newUrl = `${window.location.pathname}?q=${encodeURIComponent(query)}&tab=${currentTab}`;
684
+ window.history.pushState({ path: newUrl }, '', newUrl);
685
+ loadSurfEngine(currentTab);
686
  }
687
+ });
688
 
689
+ // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
690
+ // ุงู„ู…ุฑุงู‚ุจ ุงู„ุฐูƒูŠ: ุฅุฎูุงุก ุนู†ุงุตุฑ ุบูˆุบู„ + ุฃูŠู‚ูˆู†ุงุช ุงู„ู…ูˆุงู‚ุน
691
+ // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
692
+ const observer = new MutationObserver(() => {
693
+ document.querySelectorAll(
694
+ '.gsc-adBlock, .gcsc-branding, .gsc-result-info, .gsc-tabsArea, .gsc-refinementHeader'
695
+ ).forEach(el => el.remove());
696
+
697
+ document.querySelectorAll('.gsc-result').forEach(result => {
698
+ if (result.dataset.faviconAdded) return;
699
+ const link = result.querySelector('a.gs-title');
700
+ if (!link) return;
701
+
702
+ let domain = '';
703
+ try {
704
+ if (link.href) {
705
+ const url = new URL(link.href);
706
+ domain = url.hostname;
707
+ }
708
+ } catch (e) {}
709
+
710
+ const favicon = document.createElement('img');
711
+ favicon.className = 'gs-favicon';
712
+ favicon.alt = 'ุดุนุงุฑ ุงู„ู…ูˆู‚ุน';
713
+ favicon.loading = 'lazy';
714
+
715
+ if (domain) {
716
+ favicon.src = `https://www.google.com/s2/favicons?domain=${domain}&sz=32`;
717
+ favicon.onerror = () => {
718
+ favicon.src =
719
+ 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%236366f1"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>';
720
+ };
721
+ } else {
722
+ favicon.src =
723
+ 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%236366f1"><circle cx="12" cy="12" r="10"/></svg>';
724
+ }
725
+
726
+ if (link.firstChild) {
727
+ link.insertBefore(favicon, link.firstChild);
728
+ } else {
729
+ link.appendChild(favicon);
730
+ }
731
+ result.dataset.faviconAdded = 'true';
732
+ });
733
  });
 
734
 
735
+ observer.observe(document.body, { childList: true, subtree: true });
736
+ })();
737
  </script>
738
  </body>
739
  </html>