MyFirstUserScript_Aaron

Better Settings menu

La data de 20-08-2021. Vezi ultima versiune.

// ==UserScript==
// @name         MyFirstUserScript_Aaron
// @namespace    AaronLong
// @version      1.1
// @description  Better Settings menu
// @author       AaronLong
// @match        https://sap.service-now.com/*
// @match        https://test.itsm.services.sap/*
// @match        https://itsm.services.sap/*
// @icon         https://www.google.com/s2/favicons?domain=services.sap
// ==/UserScript==

(function() {
    'use strict';
     addButton('Hello Customer',)

    function addButton(text, onclick, cssObj) {
        cssObj = cssObj || {position: 'fixed', top: '15%', right:'4%', 'z-index': 3, fontWeight: '600', fontSize: '14px', backgroundColor: '#00cccc', color: 'white', border: 'none', padding: '10px 20px', }
        let button = document.createElement('button'), btnStyle = button.style
        document.body.appendChild(button)
        button.innerHTML = text
        button.onclick = onclick
        Object.keys(cssObj).forEach(key => btnStyle[key] = cssObj[key])
        return button
    }
    
})();