(url)
| 14576 | |
| 14577 | if (existing) existing.remove(); |
| 14578 | |
| 14579 | const script = document.createElement('script'); |
| 14580 | script.id = GOATCOUNTER_SCRIPT_ID; |
| 14581 | script.async = true; |
| 14582 | script.setAttribute('data-goatcounter', GOATCOUNTER_ENDPOINT); |
| 14583 | script.src = GOATCOUNTER_SCRIPT_SRC; |
| 14584 | document.head.appendChild(script); |
| 14585 | } else { |
| 14586 | console.log('Disabling GoatCounter'); |
| 14587 | if (existing) existing.remove(); |
| 14588 | // Neuter any already-loaded GoatCounter so further counts are no-ops |
| 14589 | window.goatcounter = { |
| 14590 | no_onload: true, |
| 14591 | count: function () {} |
| 14592 | }; |
| 14593 | } |
| 14594 | } |
| 14595 | window.toggleAnalytics = toggleAnalytics; |
| 14596 | |
| 14597 | // Add function for generating thumbnails for multiple models |
| 14598 | async function generateThumbnailsForModels(models, options = {}) { |
| 14599 | const headless = !!options.headless; |
| 14600 | const cancelRef = options.cancelRef || null; |
nothing calls this directly
no outgoing calls
no test coverage detected