Created
May 3, 2021 20:01
-
-
Save pv2b/2540b1c45519ecead7a024a29eeefa9b to your computer and use it in GitHub Desktop.
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 Hide Sweclockers Posts | |
// @author pv2b | |
// @include https://www.sweclockers.com/forum/post/* | |
// @include https://www.sweclockers.com/forum/trad/* | |
// @description Hides Sweclockers posts from certain users | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js | |
// @grant GM_addStyle | |
// ==/UserScript== | |
/* jag är kass på javascript, så ni får ha överseende med kass kod... */ | |
var blockedUsers = new Set(); | |
// Lägg till en rad för varje störig snubbe... | |
blockedUsers.add("StörigSnubbe1"); | |
blockedUsers.add("StörigSnubbe2"); | |
$("div.forum-post").each(function (index, post) { | |
var author = $(post).find("a[itemprop=author] span[itemprop=name]").text(); | |
if (blockedUsers.has(author)) { | |
$("<button>Visa dolt inlägg</button>").click(function (event) { | |
$(event.target).hide(); | |
$(post).show(); | |
}).insertBefore($(post)); | |
$(post).hide(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment