rob4iks3gmail.com / SmartBear1A 2.0 Product Counter

// ==UserScript==
// @name         SmartBear1A 2.0 Product Counter
// @namespace    http://tampermonkey.net/
// @version      3.0
// @description  SmartBear1A 2.0 Product Counter
// @author       Robis
// @match        smartbear.1a.lv/products/create*
// @grant        none
// @license      GPL-3.0
// ==/UserScript==

(function () {
    'use strict';

    function productCounter() {
        var counter = localStorage.getItem("counter"),
            counterText = document.createElement('div');

        counterText.innerHTML = ('<span id="counterText">' + counter + '</span>');
        document.body.appendChild(counterText);

        $(function () {
            $("form[name='product']").submit(function () {
                counter++;
                localStorage.setItem("counter", counter);
            });

            if ($("#form_error_block").length) {
                counter--;
                localStorage.setItem("counter", counter);
            }
        });

        counterText.innerHTML = ('<span id="counterText">' + counter + '</span>');

    }


    //Activation of Experimental Scripts
    productCounter();
})();