Soundcloud Anti Repost

Remove reposts from soundcloud

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Soundcloud Anti Repost
// @version      1.2.3
// @author       Redcrafter
// @description  Remove reposts from soundcloud
// @license      MIT
// @include      https://soundcloud.com/feed
// @run-at       document-end
// @namespace    https://github.com/Redcrafter/
// ==/UserScript==

function removeReposts() {
    for (const item of document.querySelectorAll(".soundList__item")) {
        if (item.querySelector(".soundContext__repost")) {
            item.remove();
        }
    }
}

// Searches for the playerManager module
function module(e, t, _require) {
    let modules = _require.c;

    for (let moduleid in modules) {
        if (modules.hasOwnProperty(moduleid)) {
            let el = _require(moduleid);

            if (typeof el.playCurrent === 'function') {
                init(el);
                break;
            }
        }
    }
}

function init(playManager) {
    // Inject a function to check for reposts
    let oldSet = playManager.setCurrentItem;
    playManager.setCurrentItem = (e) => {
        let r = false;
        try {
            // Not sure if this safe
            r = e._submodels[0]._events["change:user"][1].context.options.actionType === "repost";
        } catch (error) {
            // console.error("An Exception occoured while trying to determine repost status");
        }

        if (r) {
            playManager.removeItem(e);
            playManager.playNext();
        } else {
            oldSet(e);
        }
    };

}

setInterval(removeReposts, 500);

// injection our own module
unsafeWindow.webpackJsonp.push([[1000000], { 1000000: module }, [[1000000]]]);