您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a hovering back button to the bottom right corner of the webpage
// ==UserScript== // @name Hovering Back Button (Bottom Right) // @namespace http://tampermonkey.net/ // @version 0.1 // @description Adds a hovering back button to the bottom right corner of the webpage // @author Your Name // @match *://*/* // @grant none // ==/UserScript== (function() { 'use strict'; // Create the button element let backButton = document.createElement('button'); backButton.id = 'backButton'; backButton.innerText = 'Back'; // Apply styles to the button backButton.style.position = 'fixed'; backButton.style.bottom = '20px'; // Position from the bottom of the page backButton.style.right = '20px'; // Position from the right of the page backButton.style.padding = '10px 20px'; backButton.style.backgroundColor = 'rgba(128, 128, 128, 0.5)'; // Gray background with 50% transparency backButton.style.color = 'white'; backButton.style.border = 'none'; backButton.style.borderRadius = '5px'; backButton.style.cursor = 'pointer'; backButton.style.fontSize = '16px'; backButton.style.transition = 'background-color 0.3s ease'; // Add hover effect backButton.addEventListener('mouseenter', function() { backButton.style.backgroundColor = 'rgba(80, 80, 80, 0.7)'; // Slightly darker gray with 70% transparency on hover }); backButton.addEventListener('mouseleave', function() { backButton.style.backgroundColor = 'rgba(128, 128, 128, 0.5)'; // Original gray with 50% transparency }); // Add click event to go back backButton.addEventListener('click', function() { window.history.back(); }); // Append the button to the body document.body.appendChild(backButton); })();