分享:种子详情当页预览图片(不用弹出新窗口)的greasemonkey脚本
-
不爽GTRU预览图片时那个变态的弹出窗口,装了greasemonkey,写了个脚本,用FF或者Chrome的同学可以拿去。
脚本代码:
// GT.ru pic preview script
// version 0.1
// 2011-6-26
// Copyright 2011, dangl71
// Released under the GPL license
// hxxp://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script. To install it, you need
// Greasemonkey 0.3 or later: hxxp://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select "GT.ru", and click Uninstall.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name GT.ru
// @description change GT.ru pic preview
// @include http://tracker.gaytorrent.ru/details.php*
// ==/UserScript==picDiv = document.createElement("div");
picDiv.setAttribute("id", "picDiv");
picDiv.setAttribute("style", "position:absolute; top:100px; left:0px; z-index:99; visibility:hidden; width:99.6%; height:80%; text-align:center");
picDiv.innerHTML = '<iframe id="theFrame" border="0" style="width:100%; height:95%; background:gray" noresize="resize"></iframe>
>> Close Pic Preview << ';
document.body.appendChild(picDiv);newScript = document.createElement("script");
newScript.innerHTML = 'function showpic(pic) { document.getElementById("theFrame").src="/showpic.php?pic=" + pic; document.getElementById("picDiv").style.visibility="visible"; document.getElementById("picDiv").style.top = window.pageYOffset + "px"; } function hidePic() { document.getElementById("picDiv").style.visibility="hidden"; }';
document.body.appendChild(newScript);newScript = document.createElement("script");
newScript.innerHTML = 'window.onscroll = function () { document.getElementById("picDiv").style.top = window.pageYOffset + "px" }';
document.body.appendChild(newScript);function scrollpicDiv(){ document.getElementById("picDiv").style.posTop = document.body.scrollTop; }
以上脚本。
首先要安装greasemonkey插件(重启FF以后才可以应用)。把这段代码复制下来,存成 yourfilename.user.js 文件,把它拖进FF窗口,应该就可以了。
@管理员/版主:
@include那一句链接的是本站URL,不要改成hxxp哦!