Snipplr纯文本/高亮文本Greasemonkey脚本
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Snipplr纯文本/高亮文本Greasemonkey脚本相关的知识,希望对你有一定的参考价值。
When you're viewing an older version of a snippet, the Plain Text and Highlighted Text links point back to the latest version. This greasemonkey script fixes those links to point to the version you're currently viewing.
// ==UserScript== // @name Fix Snippet's Plain/Highlighted Text link // @author Andy Harrison // @namespace http://dragonzreef.com/greasemonkey/snipplr_plainhighlighted.user.js // @description When viewing a snippet, fixes the Plain/Highligted Text link to go to the version you're looking at instead of the latest version. // @include http://snipplr.com/view* // ==/UserScript== window.addEventListener("load", function() { var viewbar = document.getElementById("viewsource"); if(!viewbar) return; var a = viewbar.getElementsByTagName("a"); for(var i=0; i<a.length; i++) { { a[i].href += document.location.href.replace(/^http://snipplr.com/view/d+(.d+).*$|.*/,"$1"); return; } else if(a[i].innerHTML == "Highlighted Text") { var vers = document.location.href.replace(/^http://snipplr.com/view.php?([^#]*&)*?id=d+(.d+).*$|.*/,"$2"); a[i].href = a[i].href.replace(/^(http://snipplr.com/view/d+)(.*)$/, "$1"+vers+"$2"); return; } } }, false);
以上是关于Snipplr纯文本/高亮文本Greasemonkey脚本的主要内容,如果未能解决你的问题,请参考以下文章