AnesKAM commited on
Commit
92160e0
·
verified ·
1 Parent(s): cce7d75

Update results.html

Browse files
Files changed (1) hide show
  1. results.html +22 -4
results.html CHANGED
@@ -159,7 +159,10 @@
159
  .sidebar-content { display: none; }
160
  .sidebar-content.active { display: block; }
161
  }
162
- </style>
 
 
 
163
  </head>
164
  <body>
165
  <div class="orb orb-1"></div>
@@ -249,7 +252,6 @@
249
  const sidebarToggle = document.getElementById('sidebarToggle');
250
  const sidebarContent = document.getElementById('sidebarContent');
251
 
252
- // Sidebar Toggle for Mobile
253
  if(sidebarToggle) {
254
  sidebarToggle.addEventListener('click', () => {
255
  sidebarContent.classList.toggle('active');
@@ -264,7 +266,6 @@
264
  });
265
  }
266
 
267
- // Initial set active tab based on URL
268
  document.querySelectorAll('.tab-pill').forEach(btn => {
269
  btn.classList.toggle('active', btn.dataset.tab === currentTab);
270
  });
@@ -276,6 +277,7 @@
276
  } else {
277
  loadingText.textContent = "يرجى إدخال كلمة بحث للبدء.";
278
  }
 
279
  function loadSurfEngine(tab) {
280
  const cx = ENGINES[tab];
281
  resultsContainer.innerHTML = '';
@@ -299,6 +301,7 @@
299
  };
300
  document.head.appendChild(script);
301
  }
 
302
  document.querySelectorAll('.tab-pill').forEach(btn => {
303
  btn.addEventListener('click', () => {
304
  currentTab = btn.dataset.tab;
@@ -310,6 +313,7 @@
310
  }
311
  });
312
  });
 
313
  document.getElementById('search-form').addEventListener('submit', (e) => {
314
  e.preventDefault();
315
  query = inputField.value;
@@ -320,9 +324,23 @@
320
  }
321
  });
322
 
323
- // مراقب إضافي للتأكد من حذف أي كلاسات تظهر متأخرة
324
  const observer = new MutationObserver((mutations) => {
325
  document.querySelectorAll('.gsc-adBlock, .gcsc-branding, .gsc-result-info, .gsc-tabsArea, .gsc-refinementHeader').forEach(el => el.remove());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
  });
327
  observer.observe(document.body, { childList: true, subtree: true });
328
  </script>
 
159
  .sidebar-content { display: none; }
160
  .sidebar-content.active { display: block; }
161
  }
162
+
163
+ .gs-favicon { width: 18px; height: 18px; vertical-align: middle; margin-left: 8px; border-radius: 4px; display: inline-block; }
164
+ .gs-title { display: flex !important; align-items: center; flex-wrap: wrap; }
165
+ </style>
166
  </head>
167
  <body>
168
  <div class="orb orb-1"></div>
 
252
  const sidebarToggle = document.getElementById('sidebarToggle');
253
  const sidebarContent = document.getElementById('sidebarContent');
254
 
 
255
  if(sidebarToggle) {
256
  sidebarToggle.addEventListener('click', () => {
257
  sidebarContent.classList.toggle('active');
 
266
  });
267
  }
268
 
 
269
  document.querySelectorAll('.tab-pill').forEach(btn => {
270
  btn.classList.toggle('active', btn.dataset.tab === currentTab);
271
  });
 
277
  } else {
278
  loadingText.textContent = "يرجى إدخال كلمة بحث للبدء.";
279
  }
280
+
281
  function loadSurfEngine(tab) {
282
  const cx = ENGINES[tab];
283
  resultsContainer.innerHTML = '';
 
301
  };
302
  document.head.appendChild(script);
303
  }
304
+
305
  document.querySelectorAll('.tab-pill').forEach(btn => {
306
  btn.addEventListener('click', () => {
307
  currentTab = btn.dataset.tab;
 
313
  }
314
  });
315
  });
316
+
317
  document.getElementById('search-form').addEventListener('submit', (e) => {
318
  e.preventDefault();
319
  query = inputField.value;
 
324
  }
325
  });
326
 
 
327
  const observer = new MutationObserver((mutations) => {
328
  document.querySelectorAll('.gsc-adBlock, .gcsc-branding, .gsc-result-info, .gsc-tabsArea, .gsc-refinementHeader').forEach(el => el.remove());
329
+
330
+ document.querySelectorAll('.gsc-result').forEach(result => {
331
+ if (result.dataset.faviconAdded) return;
332
+ const link = result.querySelector('a.gs-title');
333
+ if (link && link.href) {
334
+ try {
335
+ const url = new URL(link.href);
336
+ const favicon = document.createElement('img');
337
+ favicon.src = `https://www.google.com/s2/favicons?domain=${url.hostname}&sz=32`;
338
+ favicon.className = 'gs-favicon';
339
+ link.prepend(favicon);
340
+ result.dataset.faviconAdded = 'true';
341
+ } catch(e) {}
342
+ }
343
+ });
344
  });
345
  observer.observe(document.body, { childList: true, subtree: true });
346
  </script>