PageSourceSearch

https://drvtrd-widget.netlify.app/drivably.js

js drvtrd-widget.netlify.app collected 2026-10-03 10:40:00 UTC 3,121 bytes, 82 lines download raw bytes

1"use strict";
2
3// Create script and link tags to import initial widget chunks
4(function loadChunks(d) {
5  // Block bots from downloading widget scripts
6  var botPattern = /(googlebot|googleother|bingbot|yandexbot|baiduspider|duckduckbot|duckassistbot|applebot|adsbot-google|google-ads-conversions|google-adwords-express|meta-externalads|meta-externalagent|facebookexternalhit|facebot|twitterbot|linkedinbot|pinterest|ahrefsbot|semrush|mj12bot|dotbot|petalbot|bytespider|gptbot|chatgpt|claudebot|siteauditbot|brightedge crawler|hubspot crawler|seekportbot|ev-crawler|stripebot|sogou|mediapartners-google)/i;
7  if (typeof navigator !== 'undefined' && navigator.userAgent && botPattern.test(navigator.userAgent)) {
8    return;
9  }
10
11  // Only load widget chunks if a required container or trigger element exists
12  var requiredSelectors = ['#drvtrd-container', '#drvtrd-quick-quote', '#drvtrd-guaranteed-price', '.drvtrd-open-guaranteed-price', '.drvtrd-open-widget'];
13  var hasRequiredElement = function () {
14    return requiredSelectors.some(function (selector) {
15      return d.querySelector(selector);
16    });
17  };
18  var domain = "https://widget.clearcar.com/" || 'https://widget.clearcar.com/';
19  var filePrefix = 'drvtrd-';
20  var chunks = [{
21    name: 'runtime'
22  }, {
23    name: 'vendors',
24    hasCss: false
25  }, {
26    name: 'main',
27    hasCss: false
28  }];
29  var injectChunks = function () {
30    chunks.forEach(function (chunk) {
31      // JS
32      var r = `${domain}${filePrefix}${chunk.name}.js`;
33      if (!d.querySelector(`[src="${r}"]`)) {
34        var script = d.createElement('script');
35        script.src = r;
36        script.defer = !0;
37        script.async = !0;
38        d.body.append(script);
39      }
40      if (chunk.hasCss) {
41        // CSS
42        var rc = `${domain}${filePrefix}${chunk.name}.css`;
43        if (!d.querySelector(`[href="${rc}"]`)) {
44          var link = d.createElement('link');
45          link.rel = 'stylesheet';
46          link.type = 'text/css';
47          link.href = rc;
48          d.head.append(link);
49        }
50      }
51    });
52  };
53  if (hasRequiredElement()) {
54    injectChunks();
55    return;
56  }
57
58  // SPA sites may render the container/trigger asynchronously, or only
59  // after a client-side route change past the page this script tag first
60  // executed on. Keep watching instead of giving up after a single check,
61  // so the widget bundle loads whenever the element eventually appears.
62  //
63  // This script is embedded on many sites, some of which may never render
64  // a widget element on a given page, so the watch is bounded: it stops
65  // itself after ContainerWatchTimeout rather than observing indefinitely.
66  var ContainerWatchTimeout = 5 * 60 * 1000;
67  var observer = new MutationObserver(function () {
68    if (hasRequiredElement()) {
69      observer.disconnect();
70      clearTimeout(watchTimeoutId);
71      injectChunks();
72    }
73  });
74  var watchTimeoutId = setTimeout(function () {
75    observer.disconnect();
76  }, ContainerWatchTimeout);
77  observer.observe(d.documentElement, {
78    childList: true,
79    subtree: true
80  });
81})(document);
82//# sourceMappingURL=drivably.js.map

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.