Remove Javbus Banner Ad

Remove the banner ad at the top of javbus.com and make copy instead of open scheme

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

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 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.

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

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         Remove Javbus Banner Ad
// @namespace    Violentmonkey Scripts
// @version      0.2
// @description  Remove the banner ad at the top of javbus.com and make copy instead of open scheme
// @author       TAB
// @match        *://*.javbus.com/*
// @license      GNU GPLv3
// @grant        GM_setClipboard
// ==/UserScript==

function copyMagnet(){
      // 获取所有包含指定 onclick 事件的 <td> 元素
    var tdElements = document.querySelectorAll('td[onclick^="window.open(\'magnet"]');

    // 遍历每个 <td> 元素
    tdElements.forEach(function(td) {
        // 获取 magnet 链接
        var magnetLink = td.getAttribute('onclick').match(/'([^']+)'/)[1];

        // 移除原有点击事件
        td.removeAttribute('onclick');

        // 添加新的点击事件,复制 magnet 链接到剪贴板
        td.addEventListener('click', function() {
            GM_setClipboard(magnetLink);
            console.log('Magnet link copied to clipboard:', magnetLink);
        });
    });
}


(function() {
    'use strict';


  // 创建一个 MutationObserver 实例,监听页面内容的变化
    var observer = new MutationObserver(function(mutationsList) {
        // 当页面内容发生变化时执行以下操作
        mutationsList.forEach(function(mutation) {
            // 检查变化是否与 AJAX 请求有关
            if (mutation.type === 'childList') {
                // 在这里可以执行你想要的操作,例如修改页面内容、添加新元素等
                console.log('Page content changed after AJAX request');

                copyMagnet();

                var banner = document.querySelector('.ad-box');
                if (banner) {
                  banner.remove();
                }
            }
        });
    });

    // 启动 MutationObserver 监听页面内容的变化
    observer.observe(document.body, { childList: true, subtree: true });


})();