Greasy Fork is available in English.
Link to posts in the same 4chan thread with "@".
当前为
// ==UserScript==
// @name @-posting
// @version 0.2.2.0
// @namespace atposting
// @license WTFPL
// @include *://boards.4chan.org/*
// @run-at document-end
// @grant none
// @description Link to posts in the same 4chan thread with "@".
// ==/UserScript==
var twitterify = function(targets) {
Array.prototype.forEach.call(targets, function(target) {
target.innerHTML = target.innerHTML.replace(
/@([0-9]+)/,
'<a href="#p$1" class="quotelink">@$1</a>'
);
});
};
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
twitterify(mutation.addedNodes);
});
});
observer.observe(document.querySelector('.board .thread'), { attributes: true, childList: true });
twitterify(document.querySelectorAll('.postMessage'));