Greasy Fork is available in English.
在网页上增加一个按钮
当前为
// ==UserScript==
// @name Add Paid Library Button
// @namespace http://tampermonkey.net/
// @version 1.0
// @description 在网页上增加一个按钮
// @author Your Name
// @match *://*/*
// @grant GM_xmlhttpRequest
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// 新增付费库按钮
if (!document.getElementById('paidLibraryButton')) {
const paidLibraryButton = document.createElement('button');
paidLibraryButton.id = 'paidLibraryButton';
paidLibraryButton.innerHTML = '付费库';
paidLibraryButton.style.position = 'fixed';
paidLibraryButton.style.top = '135px'; // 位置在换按钮的下面
paidLibraryButton.style.right = '20px';
paidLibraryButton.style.width = '39px';
paidLibraryButton.style.height = '39px';
paidLibraryButton.style.borderRadius = '50%';
paidLibraryButton.style.backgroundColor = '#d85cf3';
paidLibraryButton.style.color = 'yellow';
paidLibraryButton.style.border = 'none';
paidLibraryButton.style.cursor = 'pointer';
paidLibraryButton.style.zIndex = '9999';
paidLibraryButton.style.boxShadow = '0px 4px 8px rgba(0, 0, 0, 0.2)';
paidLibraryButton.style.fontSize = '12px';
paidLibraryButton.style.fontWeight = '500';
paidLibraryButton.style.textAlign = 'center';
paidLibraryButton.style.lineHeight = '39px';
document.body.appendChild(paidLibraryButton);
paidLibraryButton.addEventListener('click', function () {
window.location.href = 'https://afdian.net/a/warmo';
});
}
})();