Greasy Fork is available in English.

closeBanner

try to take over the world!

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         closeBanner
// @namespace    http://tampermonkey.net/
// @version      0.2.3
// @description  try to take over the world!
// @author       anonym
// @grant        none
// @include        https://alpha.e-sim.org/battle.html?id=*
// @include        https://primera.e-sim.org/battle.html?id=*
// ==/UserScript==
const closeBanners = () => {
    const banners = document.querySelectorAll('.ui-dialog.ui-widget.ui-widget-content.ui-corner-all.ui-draggable.ui-dialog-buttons');

    const closeBanner = (banner) => {
    const observer = new MutationObserver(mutationRecords => {
    const display = mutationRecords[0].target.style.display;
        if(display === 'block') {
        const btnYes = banner.querySelectorAll('.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only')[0];
    const event = new Event('click');
    console.log('banner');
    btnYes.dispatchEvent(event);
        }
 
});

  observer.observe(banner, {
  attributes: true
});

};
    let i;
    if(document.URL.indexOf('primera') > 0){
        i = 0;
    } else {
       i = 1;
    }

    for(i; i< banners.length; i++) {
        closeBanner(banners[i]);
    }
}

let script = document.createElement('script');
	script.textContent = '(' + closeBanners + ')(jQuery, window);';
	document.body.appendChild(script);