Warning: fopen(/www/sites/update.greasyfork.icu/index/store/temp/8f2f3ff787b50cfcf3ffefcfc89e2258.js): failed to open stream: No space left on device in /www/sites/update.greasyfork.icu/index/scriptControl.php on line 65
// ==UserScript==
// @name YTS - Hide Opened Movies
// @namespace https://greasyfork.org/en/users/670188-hacker09?sort=daily_installs
// @version 2
// @description Hide all movies that you have previously opened when browsing YTS.
// @author hacker09
// @include https://yts.mx/browse-movies/*
// @include https://yts.mx/movies/*
// @icon https://yts.mx/assets/images/website/apple-touch-icon-180x180.png
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_listValues
// @run-at document-end
// @downloadURL https://update.greasyfork.icu/scripts/486719/YTS%20-%20Hide%20Opened%20Movies.user.js
// @updateURL https://update.greasyfork.icu/scripts/486719/YTS%20-%20Hide%20Opened%20Movies.meta.js
// ==/UserScript==
(function() {
'use strict';
if (location.href.match('https://yts.mx/movies') !== null) { //If the opened link is a movie page
GM_setValue(location.href, location.href); //Store the URL
} //Finishes the if condition
setInterval(function() { //Starts the setInterval function
GM_listValues().forEach((link) => { //ForEach stored URL
document.querySelector(`[href="${GM_getValue(link)}"]`) !== null ? document.querySelector(`[href="${GM_getValue(link)}"]`).parentNode.style.display = 'none' : ''; //Hide the previously opened movie page
}); //Finishes the ForEach loop
}, 2000); //Finishes the setInterval function
})();