Created
December 2, 2016 11:04
-
-
Save amarkulo/9d97f598eb968166f77c6d78dc3af619 to your computer and use it in GitHub Desktop.
Klix unread post fix tampermonkey script for Chrome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Klix unread posts fix | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Unread posts fix for permalinks | |
// @author Amar Kulo (amar@url.ba) | |
// @match http://forum.klix.ba/search.php?* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
var links = document.evaluate("//a[contains(@href, 'unread#unread')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); | |
for (var i=0; i < links.snapshotLength; i++) | |
{ | |
var thisLink = links.snapshotItem(i); | |
var threadPrefix = new String(thisLink.href.match(/t\d{2,}/)); | |
thisLink.href = 'http://forum.klix.ba/viewtopic.php?t=' + threadPrefix.substr(1) + '&view=unread#unread'; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment