Bloxflip Ad Remover

Ad remover for bloxflip

// ==UserScript==
// @name         Bloxflip Ad Remover
// @namespace    Mohalk
// @version      1.0
// @description  Ad remover for bloxflip
// @author       Mohalk
// @match        https://bloxflip.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    function removeAdElement() {
        var adDiv = document.getElementById("nitro-ad-deposit");
        if (adDiv) {
            adDiv.remove();
            observer.disconnect();
        }
    }

    var observer = new MutationObserver(function(mutationsList, observer) {
        for (var mutation of mutationsList) {
            if (mutation.type === "childList") {
                if (document.getElementById("nitro-ad-deposit")) {
                    removeAdElement();
                }
            }
        }
    });

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

    if (document.getElementById("nitro-ad-deposit")) {
        removeAdElement();
    }
})();