您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Nomination workaround
// ==UserScript== // @name Nominate hack // @description Nomination workaround // @namespace http://poems-and-quotes.com // @include http://www.best-love-poems.com/poems.php?id=* // @include http://www.friendship-poems.com/poems.php?id=* // @version 1 // ==/UserScript== var zNode = document.createElement ('div'); zNode.innerHTML = '<button id="myButton" type="button">' + 'Nominate Hack</button>' ; zNode.setAttribute ('id', 'myContainer'); document.body.appendChild (zNode); //--- Activate the newly added button. document.getElementById ("myButton").addEventListener ( "click", ButtonClickAction, false ); function ButtonClickAction (zEvent) { /*--- For our dummy action, we'll just add a line of text to the top of the screen. */ var currentLocation = window.location.href; var lovePoemTest = currentLocation.search("love"); var newLocation; if (lovePoemTest != -1) { newLocation = currentLocation.replace("http://www.best-love-poems.com/poems.php?id=", "http://www.poems-and-quotes.com/misc/poems.php?id="); } var friendshipPoemTest = currentLocation.search("friendship"); if (friendshipPoemTest != -1) { newLocation = currentLocation.replace("http://www.friendship-poems.com/poems.php?id=", "http://www.poems-and-quotes.com/misc/poems.php?id="); } window.location = newLocation; } //--- Style our newly added elements using CSS. GM_addStyle ( multilineStr ( function () {/*! #myContainer { position: absolute; top: 0; left: 0; font-size: 20px; background: orange; border: 3px outset black; margin: 5px; opacity: 0.9; z-index: 222; padding: 5px 20px; } #myButton { cursor: pointer; } #myContainer p { color: red; background: white; } */} ) ); function multilineStr (dummyFunc) { var str = dummyFunc.toString (); str = str.replace (/^[^\/]+\/\*!?/, '') // Strip function () { /*! .replace (/\s*\*\/\s*\}\s*$/, '') // Strip */ } .replace (/\/\/.+$/gm, '') // Double-slash comments wreck CSS. Strip them. ; return str; }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址