PageSourceSearch

https://www.ferraracandyshopusa.com/themes/site/js/destini.js?t3g0pp

js ferraracandyshopusa.com collected 2026-10-02 10:13:59 UTC 1,929 bytes, 61 lines download raw bytes

1/*$('.buynow').click(function () {
2        var containerId = $(this).attr('data-destini-container');
3        var associationId = $(this).attr('data-destini-association');
4        destini.init(containerId);
5        destini.loadWidget(associationId);
6    });*/
7    jQuery('.launch-locator-modal').click(function () {
8        jQuery('.wtb-modal').addClass("show");
9    });
10    jQuery('#brandSection .close').click(function () {
11        jQuery('.wtb-modal').removeClass("show");
12    });
13    
14    
15
16// this function will live in UI Core
17// Sanitize URLs by converting to lowercase (optional),
18// trimming query parameters, and trimming any trailing slashes
19function sanitizeURL(url, noLowerCase = false) {
20    try {
21        if (typeof url !== 'string') {
22            throw new Error('URL must be a string');
23        }
24
25        const parsedUrl = new URL(url);
26
27        // Build sanitized URL: origin + pathname
28        let sanitized = parsedUrl.origin + parsedUrl.pathname;
29
30        // Remove trailing slash
31        if (sanitized.endsWith('/')) {
32            sanitized = sanitized.slice(0, -1);
33        }
34
35        // Convert to lowercase if needed
36        return noLowerCase ? sanitized : sanitized.toLowerCase();
37
38    } catch (error) {
39        console.error('URL sanitization failed:', error);
40        return url; // Fallback to original if something breaks
41    }
42}
43
44// Get current URL
45const currentURL = window.location.href;
46
47// Parse it
48const parsed = new URL(currentURL);
49
50// Extract query string and pathname
51const hasQueryParams = parsed.search.length > 0;
52const pathSegments = parsed.pathname.split('/').filter(Boolean);
53
54// Only redirect if 4th segment is 'brands' and query params exist
55if (hasQueryParams && pathSegments[0] === 'brands') {
56    const cleanedURL = sanitizeURL(currentURL);
57    
58    if (cleanedURL !== currentURL) {
59        window.location.replace(cleanedURL); // Use replace to avoid polluting history
60    }
61}

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.