Greasy Fork

Pastebin Improved

Some improvements to Pastebin.com, colored buttons etc.

目前为 2019-07-09 提交的版本。查看 最新版本

// ==UserScript==
// @name         Pastebin Improved
// @namespace    https://greasyfork.org/users/166103
// @version      0.3
// @description  Some improvements to Pastebin.com, colored buttons etc.
// @author       https://github.com/Amarok24
// @match        https://pastebin.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';


var pbButtons = document.querySelectorAll(".buttonsm");

if (pbButtons) {

    var indexOfEditButton = null;

    for (let i = 0; i < pbButtons.length; i++) {
        if (pbButtons[i].innerText == "edit") {
            indexOfEditButton = i;
            break;
        }
    }

    if (indexOfEditButton) {
        console.log("Edit button found, index = " + indexOfEditButton);
        pbButtons[indexOfEditButton].style.backgroundColor = "coral";
        pbButtons[indexOfEditButton].style.fontWeight = 700;
    }

}

})();