Add a button to trigger an action
Tính đến
// ==UserScript==
// @name My Script
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Add a button to trigger an action
// @author Your name
// @match *://*.xinyinli.com/*
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
function addButton() {
const button = document.createElement('button');
button.textContent = 'My Button';
button.addEventListener('click', () => {
// Add your action here
});
document.body.appendChild(button);
}
addButton();
})();