Greasy Fork is available in English.

Woolworths check stock

Add ostore parameter to Woolworths URL if not present

// ==UserScript==
// @name         Woolworths check stock
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Add ostore parameter to Woolworths URL if not present
// @author       cloudy-sfu
// @match        https://www.woolworths.co.nz/shop/productdetails*
// @grant        none
// @license      GPLv3
// ==/UserScript==
 
(function() {
    'use strict';
    // Get current URL
    let currentUrl = window.location.href;
    // Check if "ostore" parameter is present
    if (!currentUrl.includes("ostore")) {
        // Append "ostore" parameter to the URL
        let newUrl = currentUrl.includes("?") ? currentUrl + "&ostore=9500" : currentUrl + "?ostore=9500";
        // Redirect to the new URL
        window.location.href = newUrl;
    }
})();