Photopea No Ads One-liner

Hide Photopea Ads

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 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         Photopea No Ads One-liner
// @version      0.0.2
// @description  Hide Photopea Ads
// @icon         https://www.photopea.com/promo/thumb256.png

// @author       ml98
// @namespace    http://tampermonkey.net/
// @license      MIT

// @match        https://www.photopea.com/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

/* Plan A */
String.prototype.split=(f=>function(){return f.apply(this.replace('photopea','vectorpea'),arguments)})(String.prototype.split)

/* Plan B */
/*
Object.defineProperty(Object.prototype,'Vn',{get:_=>0})
*/

/* Plan C */
/*
let state = -1;
const charCodeAt = String.prototype.charCodeAt;
String.prototype.charCodeAt = function (n) {
    if (this == 'YMVVHAj=FA' && state == -1) {
        state = 0;
    }
    return charCodeAt.call(this, n);
};
const fromCharCode = String.fromCharCode;
String.fromCharCode = function () {
    if (state >= 0 && state < 10) {
        return state++ == 0 ? 'photopea.com' : '';
    }
    state = -1;
    return fromCharCode.apply(this, arguments);
};
*/

/* Not working anymore */
/*
location.hash = '#8887';
*/