Pixlr Premium Content Remover

Removes premium features on Pixlr.com, because they are just on your way.

目前為 2021-05-01 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Pixlr Premium Content Remover
// @version      1.0.2
// @description  Removes premium features on Pixlr.com, because they are just on your way.
// @author       HKR
// @match        https://pixlr.com/*
// @grant        none
// @namespace    https://greasyfork.org/users/733211
// ==/UserScript==

(function() { try{
async function addGlobalStyle(css) {
	var head, style;
	head = document.getElementsByTagName('head')[0];
	if (!head) { return; }
	style = document.createElement('style');
	style.type = 'text/css';
	style.innerHTML = css;
	head.appendChild(style);
}

async function noPremiumFeatures() {
    if (window.location.href.indexOf("editor") > -1) {
        document.getElementById("tool-glitch").outerHTML = "";
        document.getElementById("tool-focus").outerHTML = "";
        document.getElementById("cutout-auto").outerHTML = '<a class="" id="cutout-auto"></a>';

		addGlobalStyle('.button.green { visibility: hidden !important; }');
		
			while(true) {
				await new Promise(r => setTimeout(r, 1));
					(function() {
						const overlayelements = document.getElementsByClassName("element-group");
						for (var step = 0; step < overlayelements.length; step++)
						{
							if (overlayelements[step].getElementsByClassName("wrap overlay premium").length > 0) 
								overlayelements[step].remove();
						}
					}
        )();
				await new Promise(r => setTimeout(r, 1));
					(function() {
						const overlayelements = document.getElementsByClassName("element-group");
						for (var step = 0; step < overlayelements.length; step++)
						{
							if (overlayelements[step].getElementsByClassName("wrap shape premium").length > 0) 
								overlayelements[step].remove();
						}
					}
        )();
				await new Promise(r => setTimeout(r, 1));
					(function() {
						const overlayelements = document.getElementsByClassName("element-group");
						for (var step = 0; step < overlayelements.length; step++)
						{
							if (overlayelements[step].getElementsByClassName("wrap sticker premium").length > 0) 
								overlayelements[step].remove();
						}
					}
        )();
				await new Promise(r => setTimeout(r, 1));
					(function() {
						const overlayelements = document.getElementsByClassName("element-group");
						for (var step = 0; step < overlayelements.length; step++)
						{
							if (overlayelements[step].getElementsByClassName("wrap border premium").length > 0) 
								overlayelements[step].remove();
						}
					}
        )();
				await new Promise(r => setTimeout(r, 1));
					(function() {
						const elements = document.getElementsByClassName("text-box premium");
						while (elements.length > 0) elements[0].remove();
					}
				)
        ();
				await new Promise(r => setTimeout(r, 1));
					(function() {
						const elements = document.getElementsByClassName("font-pod premium");
						while (elements.length > 0) elements[0].remove();
					}
				)
			();
		}
    } else {
        document.getElementById("get-premium").outerHTML = "";
        document.getElementById("template-holder-title").outerHTML = "";
        document.getElementById("template-holder").outerHTML = "";
        document.getElementById("template-carousel").outerHTML = "";
        document.getElementById("recommended-view-more").outerHTML = "";
        document.getElementById("template-loading").outerHTML = "";
    }
}

let currentPage = location.href;

noPremiumFeatures();

setInterval(async function()
{
    if (currentPage != location.href)
    {
        currentPage = location.href;
        noPremiumFeatures();
        
}}, 100);} catch(err) {} })();