hello world

new ss

目前為 2024-06-26 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         hello world
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @description  new ss
// @author       You
// @match        *://*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=0.1
// @license           Apache-2.0
// @grant        none
// ==/UserScript==

(function () {
    'use strict';
    document.addEventListener('DOMContentLoaded', function () {
        // 创建一个新的按钮元素
        var button = document.createElement('button');
        button.innerHTML = '点击我!';
        button.style.position = 'fixed';
        button.style.display = 'block'
        button.style.top = '10px';
        button.style.left = '10px';
        button.style.zIndex = 9999;
        button.style.backgroundColor = '#007bff'; // 添加背景色以便观察
        button.style.color = '#ffffff'; // 文字颜色
        button.style.padding = '10px 20px'; // 内边距
        button.style.border = 'none'; // 移除边框
        button.style.cursor = 'pointer'; // 鼠标悬停时变为手型

        // 为按钮添加点击事件监听器
        button.addEventListener('click', function () {
            console.log('按钮被点击了!');
            // 在这里添加你想在点击按钮时执行的其他操作
        });

        // 将按钮添加到页面的body中
        document.body.appendChild(button);
        console.log(button);
    });
})();