PageSourceSearch

https://andrewsag.com/assets/brand-logo-fallback.js?v=20260831-1

js andrewsag.com collected 2026-10-08 21:34:44 UTC 4,076 bytes, 74 lines download raw bytes

1(() => {
2  const OFFICIAL_LOGOS = {
3    'STIHL': { src: 'https://www.stihlusa.com/en/support-events/about-stihl/corporate-information/_jcr_content/root/container/container/textimage_copy_copy__747550642.coreimg.jpeg/1767882661972/stihl-logo-vu-p-2022-12.jpeg', plate: 'light' },
4    'Highline Manufacturing': { src: 'https://cdn.prod.website-files.com/699740cfe7ced13dcf50aac3/699740cfe7ced13dcf50abc3_highline_logo_Black_post_amalgamation-1.avif', plate: 'light' },
5    'MacDon': { src: 'https://images1.farms.com/agsearch-production-images/assets/images/macdon-industries-ltd/logos/8092.jpg', plate: 'light' },
6    'TeeJet Technologies': { src: 'https://static.wixstatic.com/media/3a2368_e0c4f99fed854c7d93a8074acc1d980a~mv2.png/v1/crop/x_0%2Cy_3%2Cw_143%2Ch_55/fill/w_306%2Ch_124%2Cal_c%2Clg_1%2Cq_90/teejet-logo.png', plate: 'light' },
7    'Banjo': { src: 'https://www.banjocorp.com/banjo/_ui/desktop/theme-Banjo/images/Banjo-Logo-2016_200x68-a.png', plate: 'light' },
8    'Yetter': { src: 'https://www.yetterco.com/img/logo-print2.jpg', plate: 'light' },
9    'Outback Guidance': { src: 'https://www.outbackguidance.com/portals/0/Outback_logo_sm.png', plate: 'light' },
10    'Precision Planter Solutions': { src: 'https://static.wixstatic.com/media/e35042_cc0ac99ef50e451ba95461237fce478a~mv2.jpg/v1/fill/w_632%2Ch_332%2Cal_c%2Cq_90/e35042_cc0ac99ef50e451ba95461237fce478a~mv2.jpg', plate: 'light' },
11    'SCH Schumacher': { src: 'https://groupschumacher.com/wp-content/uploads/2026/01/sch-logo-scaled.png', plate: 'light' },
12    'LAFORGE Group': { src: 'https://www.laforgegroup.com/wp-content/uploads/2021/05/logo-laforge-blanc-small.png', plate: 'dark' },
13    'Belmont Trailers': { src: 'https://belmonttrailers.com/wp-content/uploads/2023/03/Built_To_Take_It_-1.jpg', plate: 'light' }
14  };
15
16  const faviconFor = href => {
17    try {
18      const host = new URL(href, window.location.href).hostname.replace(/^www\./, '');
19      return host ? `https://www.google.com/s2/favicons?sz=128&domain=${encodeURIComponent(host)}` : '';
20    } catch (_) {
21      return '';
22    }
23  };
24
25  const contextFor = link => {
26    if (link.classList.contains('prominent-brand-card')) return 'featured';
27    if (link.classList.contains('all-brand-link')) return 'list';
28    if (link.closest('.brand-marquee')) return 'marquee';
29    return 'list';
30  };
31
32  const addLogo = identity => {
33    if (!(identity instanceof HTMLElement) || identity.querySelector('.brand-logo-image')) return;
34    const link = identity.closest('a[href]');
35    if (!link) return;
36    const name = identity.querySelector('.brand-name')?.textContent?.trim() || (link.getAttribute('aria-label') || '').replace(/^Visit\s+/i, '').replace(/\s+website$/i, '').trim();
37    const fallback = faviconFor(link.href);
38    const preferred = OFFICIAL_LOGOS[name];
39    const src = preferred?.src || fallback;
40    if (!src) return;
41
42    const img = document.createElement('img');
43    img.className = `brand-logo-image brand-logo-${contextFor(link)} logo-plate-${preferred?.plate || 'light'}`;
44    img.src = src;
45    img.alt = '';
46    img.loading = 'lazy';
47    img.decoding = 'async';
48    img.referrerPolicy = 'no-referrer';
49    img.addEventListener('error', () => {
50      if (fallback && img.src !== fallback) {
51        img.src = fallback;
52        img.classList.remove('logo-plate-dark');
53        img.classList.add('logo-plate-light');
54      } else {
55        img.remove();
56      }
57    });
58    identity.prepend(img);
59  };
60
61  const repair = root => root.querySelectorAll?.('.brand-identity').forEach(addLogo);
62  const start = () => {
63    repair(document);
64    if (!('MutationObserver' in window)) return;
65    new MutationObserver(records => records.forEach(record => record.addedNodes.forEach(node => {
66      if (!(node instanceof HTMLElement)) return;
67      if (node.matches?.('.brand-identity')) addLogo(node);
68      repair(node);
69    }
69))).observe(document.body, { childList: true, subtree: true });
70  };
71
72  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, { once: true });
73  else start();
74})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.