Orcpub to Dice by PCalc

Redirect links to

Устаревшая версия за 21.01.2024. Перейдите к последней версии.

// ==UserScript==
// @name     Orcpub to Dice by PCalc
// @include  https://www.dungeonmastersvault.com/*
// @namespace    http://tampermonkey.net/
// @description  Redirect links to 
// @license MIT
// @author       Igor Makarov
// @grant        none
// @require      https://code.jquery.com/jquery-latest.js
// @version 0.0.1.20240121151056
// ==/UserScript==

var buttonsCount = 0;
function modifyButtons() {
    let buttons = $('button.roll-button');
    if (buttons.length == buttonsCount) {
        return;
    }
    buttonsCount = buttons.length;
    buttons.each(function() {
        $(this).removeAttr('onclick');
        $(this).click(function(){ console.log("xxx"); });
    });
}

$(document).ready(modifyButtons);
$(document).bind("DOMSubtreeModified", modifyButtons);