A click away...

HarborFreight.com Historical Price Tracker Script

This userscript adds a “View Price History & Coupons” button above prices on product pages, linking to live charts at hfpricetracker.com. This HarborFreight.com Price Tracker Script will save you money on tools!

By WebmasterUpdated   43 Views
price tracker harbor freight

Script

This Tampermonkey/greasyfork user scripts adds a link on HarborFreight product page that gives you access to historical pricing.

/// ==UserScript==
// @name         Harbor Freight Price Tracker Link by Maggew.com
// @namespace    http://tampermonkey.net/
// @version      4.1
// @description  Add HF Price Tracker link to Harbor Freight product pages - Sponsored by Maggew.com 🤠
// @author       Maggew.com
// @match        https://www.harborfreight.com/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';

    let lastUrl = location.href;

    function checkForProduct() {
        // Extract item ID from URL
        const urlMatch = window.location.pathname.match(/-(\d{5,})\.html$/);
        if (!urlMatch) return;

        const itemId = urlMatch[1];
        const trackerUrl = `https://hfpricetracker.com/tools/${itemId}`;

        let attempts = 0;

        function addBox() {
            attempts++;
            if (attempts > 20) return;

            // Already added?
            if (document.querySelector('.hf-price-tracker-box')) return;

            // Find the right column (where price is)
            const rightColumn = document.querySelector('.product__topRightWrap--KiINIB');
            if (!rightColumn) {
                setTimeout(addBox, 500);
                return;
            }

            // Create the white box
            const box = document.createElement('div');
            box.className = 'hf-price-tracker-box';
            box.style.cssText = `
                background: white;
                padding: 0px;
            `;

            const link = document.createElement('a');
            link.href = trackerUrl;
            link.target = '_blank';
            link.style.cssText = `
                display: flex;
                align-items: center;
                gap: 10px;
                color: #CD2215;
                text-decoration: none;
                font-size: 16px;
                font-weight: 600;
                padding: 15px;
                border: 3px dashed;
            `;

            link.innerHTML = `
                <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
                    <path d="M3 3v18h18"/>
                    <path d="M18 17l-5-5-4 4-6-6"/>
                </svg>
                <span>View Price History & Coupons</span>
                <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                    <path d="M5 12h14M12 5l7 7-7 7"/>
                </svg>
            `;

            link.onmouseenter = () => {
                link.style.color = '#b61e13';
            };
            link.onmouseleave = () => {
                link.style.color = '#e21d38';
            };

            box.appendChild(link);

            // Insert at the very top of the right column
            rightColumn.insertBefore(box, rightColumn.firstChild);
            console.log('HF Tracker: Added for item', itemId);
        }

        setTimeout(addBox, 1000);
    }

    // Run on initial load
    checkForProduct();

    // Watch for URL changes (for SPA navigation)
    const observer = new MutationObserver(() => {
        if (location.href !== lastUrl) {
            lastUrl = location.href;
            console.log('HF Tracker: URL changed, checking for product page...');
            checkForProduct();
        }
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });

})();

How it all started…

I seen a video on YouTube (linked at very bottom) about a review for a $135 Snap-On toolbox, versus the $12 HF Mini Steel Toolbox.

One thing led to another and now we've got price tracking locked in, which is great because I've always been a fan of buying stuff on amazon when the price is right (using CamelCamelCamel).

  1. Visit HF – https://www.harborfreight.com/mini-steel-toolbox-black-72431.html
  2. Click Button above the price – https://hfpricetracker.com/tools/72431
  3. Look at price / coupon history chart
  4. Decide if you want to purchase OR
  5. Create a price alert for this tool

Misc

Share (Please Ignore)

Script

This Tampermonkey/greasyfork user scripts adds a link on HarborFreight product page that gives you access to historical pricing.

/// ==UserScript==
// @name         Harbor Freight Price Tracker Link by Maggew.com
// @namespace    http://tampermonkey.net/
// @version      4.1
// @description  Add HF Price Tracker link to Harbor Freight product pages - Sponsored by Maggew.com 🤠
// @author       Maggew.com
// @match        https://www.harborfreight.com/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';

    let lastUrl = location.href;

    function checkForProduct() {
        // Extract item ID from URL
        const urlMatch = window.location.pathname.match(/-(\d{5,})\.html$/);
        if (!urlMatch) return;

        const itemId = urlMatch[1];
        const trackerUrl = `https://hfpricetracker.com/tools/${itemId}`;

        let attempts = 0;

        function addBox() {
            attempts++;
            if (attempts > 20) return;

            // Already added?
            if (document.querySelector('.hf-price-tracker-box')) return;

            // Find the right column (where price is)
            const rightColumn = document.querySelector('.product__topRightWrap--KiINIB');
            if (!rightColumn) {
                setTimeout(addBox, 500);
                return;
            }

            // Create the white box
            const box = document.createElement('div');
            box.className = 'hf-price-tracker-box';
            box.style.cssText = `
                background: white;
                padding: 0px;
            `;

            const link = document.createElement('a');
            link.href = trackerUrl;
            link.target = '_blank';
            link.style.cssText = `
                display: flex;
                align-items: center;
                gap: 10px;
                color: #CD2215;
                text-decoration: none;
                font-size: 16px;
                font-weight: 600;
                padding: 15px;
                border: 3px dashed;
            `;

            link.innerHTML = `
                <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
                    <path d="M3 3v18h18"/>
                    <path d="M18 17l-5-5-4 4-6-6"/>
                </svg>
                <span>View Price History & Coupons</span>
                <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                    <path d="M5 12h14M12 5l7 7-7 7"/>
                </svg>
            `;

            link.onmouseenter = () => {
                link.style.color = '#b61e13';
            };
            link.onmouseleave = () => {
                link.style.color = '#e21d38';
            };

            box.appendChild(link);

            // Insert at the very top of the right column
            rightColumn.insertBefore(box, rightColumn.firstChild);
            console.log('HF Tracker: Added for item', itemId);
        }

        setTimeout(addBox, 1000);
    }

    // Run on initial load
    checkForProduct();

    // Watch for URL changes (for SPA navigation)
    const observer = new MutationObserver(() => {
        if (location.href !== lastUrl) {
            lastUrl = location.href;
            console.log('HF Tracker: URL changed, checking for product page...');
            checkForProduct();
        }
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });

})();

How it all started…

I seen a video on YouTube (linked at very bottom) about a review for a $135 Snap-On toolbox, versus the $12 HF Mini Steel Toolbox.

One thing led to another and now we've got price tracking locked in, which is great because I've always been a fan of buying stuff on amazon when the price is right (using CamelCamelCamel).

  1. Visit HF – https://www.harborfreight.com/mini-steel-toolbox-black-72431.html
  2. Click Button above the price – https://hfpricetracker.com/tools/72431
  3. Look at price / coupon history chart
  4. Decide if you want to purchase OR
  5. Create a price alert for this tool

Misc

Share (Please Ignore)

Was this helpful?

Yes! 🎉 No! 😑

Not quite what you're looking for? Get Help

Leave a Comment

Item added to cart.
0 items - $0