Dexmaster / Test Script Tracking Cookies Remover

// ==UserScript==
// @author      Dexmaster
// @include     http://www.visaliatimesdelta.com/*
// @name        Test Script Tracking Cookies Remover
// @description Test script for this request https://www.reddit.com/r/userscripts/comments/30aidn/request_paywall_bypass_for_gannett_properties/
// @namespace   TestScript
// @noframes
// @run-at      document-end
// @version     0.3.1
// @grant       none
// ==/UserScript==
(function (d, h) {
    "use strict";

    if (d.usr_trig !== undefined) {
        return;
    }

    d.usr_trig = true;

    (function (h) {
        var pushState = h.pushState;
        history.pushState = function (state) {
            if (typeof history.onpushstate === "function") {
                history.onpushstate({
                    state: state
                });
            }
            // ... whatever else you want to do
            // maybe call onhashchange e.handler
            return pushState.apply(history, arguments);
        };
    }(h));

    function del() {
        var el = d.querySelector(".util-bar-module-firefly");
        d.cookie = 'firefly_akamai_meter=; domain=.visaliatimesdelta.com; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/';
        if (el !== null) {
            el.style.display = "none";
        }
    }

    d.addEventListener("DOMContentLoaded", del);

    d.addEventListener("scroll", del);

    d.onpopstate = h.onpushstate = del;

}(document, window.history));