Better Settings menu
当前为
// ==UserScript==
// @name MyFirstUserScript_Aaron
// @namespace AaronLong
// @version 1.2
// @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 || {fontWeight: '600', fontSize: '14px', backgroundColor: '#00cccc', color: 'white', border: 'none', padding: '10px 20px', }
let div = document.createElement('div')
let button = document.createElement('button'), btnStyle = button.style
document.body.div[1].span.div.div[5].appendChild(div).appendChild(button)
button.innerHTML = text
button.onclick = onclick
Object.keys(cssObj).forEach(key => btnStyle[key] = cssObj[key])
return button
}
})();