Makes it easy to get the players you need, to finish a SBC
当前为
// ==UserScript==
// @name Extract players to buy for squad sbc
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Makes it easy to get the players you need, to finish a SBC
// @author VeryDoc
// @match https://www.futbin.com/23/squad/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=futbin.com
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
addButton('Export list', OpenSquadList);
function addButton(text, onclick, cssObj) {
cssObj = cssObj || { 'z-index': 3 }
let button = document.createElement('button'), btnStyle = button.style;
let body = document.getElementsByClassName('squad-options-block')[0];
body.appendChild(button);
button.innerHTML = text;
button.onclick = onclick;
button.classList.add('builder-ui-control-pill');
button.classList.add('active');
// btnStyle.position = 'absolute';
Object.keys(cssObj).forEach(key => btnStyle[key] = cssObj[key]);
return button;
}
function OpenSquadList() {
let mainlist = document.getElementById('prices-list-content');
let missingcards = mainlist.querySelectorAll(".player_price_name");
var htmlstr = Array.prototype.reduce.call(missingcards, function (html, node) {
return html + node.innerText + '<br/>';
}, "");
var newWin = open('', 'Export list', 'height=300,width=300');
newWin.document.write(htmlstr);
}
})();