diff --git a/javascript/Floatplane-FilterVideos.js b/javascript/Floatplane-FilterVideos.js new file mode 100644 index 0000000..ff18a6d --- /dev/null +++ b/javascript/Floatplane-FilterVideos.js @@ -0,0 +1,34 @@ +// ==UserScript== +// @name Remove Floatplane Non-Exclusive Content +// @namespace http://www.floatplane.com +// @version 0.1 +// @description Hides non-exclusive content (I watch that stuff on youtube) +// @author WTMike24 +// @match https://www.floatplane.com/ +// @icon https://www.google.com/s2/favicons?domain=floatplane.com +// @grant none +// ==/UserScript== + +(function() { + 'use strict'; + + // Your code here... + let menubar=document.getElementsByClassName('ReactProfileNavIconsContainer')[0]; + let cleanupbutton=document.createElement('div'); + cleanupbutton.classList.add("ReactProfileNavItem"); + cleanupbutton.onclick=clean; + cleanupbutton.innerHTML="FP Exclusive Filter"; + menubar.appendChild(cleanupbutton); + + function clean() { + document.getElementsByClassName('ReactElementGridItem').forEach( + function(element){ + let _title=element.children[0].children[1].children[1].children[0].innerText; + if (!_title.includes('Floatplane') && !_title.includes('FP Exclusive')){ + console.log('removing'+_title); + element.remove(); + } + } + ); + } +})();