PostPrime - Hide Marked Posts

Hide Marked Posts in PostPrime timeline

נכון ליום 17-04-2022. ראה הגרסה האחרונה.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         PostPrime - Hide Marked Posts
// @namespace    https://github.com/y-muen
// @version      0.1.1
// @description  Hide Marked Posts in PostPrime timeline
// @author       y-marui
// @include      *://postprime.com/*
// @icon         https://www.google.com/s2/favicons?domain=postprime.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const hideMarked_sub = function(elem){
        var res = elem.getElementsByClassName("PostReActions_icon___YvyJ")
        res = res[0].getElementsByTagName("img")
        if (res[1].src.match(/heart-on/)){
            elem.style.display="none";
        }
    };

    const hideMarked = function() {
        var res = document.getElementsByClassName("Post_postWrapper__XXhlo");
        if (res.length > 0) {
            for (const elem of res) {
                if (elem.style.display =="" ){
                    hideMarked_sub(elem);
                }
            }
        }
    };

    setInterval(hideMarked, 1000);
})();