Last active
September 24, 2023 01:14
-
-
Save dimmuboy/9cabde3d0da76a77b6568670094d2be9 to your computer and use it in GitHub Desktop.
Photopea without ads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Photopea | |
// @namespace www.photopea.com | |
// @description Photopea without ads | |
// @include https://www.photopea.com/ | |
// @version 1.2 | |
// @run-at document-end | |
// ==/UserScript== | |
function removeAds(){ | |
// remove ads bar | |
var adsBar = document.getElementsByClassName('rightmost'); | |
for (var l = 0; l < adsBar.length; l++) { | |
var ads = adsBar[l]; | |
console.log(ads); | |
ads.remove(); | |
} | |
// expand document area | |
var mainblock = document.getElementsByClassName('mainblock'); | |
mainblock[0].style.width = '100%'; | |
var panelhead = document.getElementsByClassName('panelhead'); | |
panelhead[0].style.maxWidth = '100%'; | |
panelhead[0].nextSibling.style.width = '100%'; | |
// unify color for links | |
var account = document.getElementsByClassName('fitem bbtn'); | |
account[0].remove(); | |
var panelmainblock = document.getElementsByClassName('panelblock mainblock'); | |
panelmainblock[0].style.width = '100%'; | |
var topbar = document.getElementsByClassName('topbar')[0].parentNode; | |
topbar.style.width = '100%'; | |
var topbar2 = document.getElementsByClassName('topbar')[0].parentNode.parentNode; | |
topbar2.style.width = '100%'; | |
var mainblockNew = document.getElementsByClassName('flexrow app')[0].firstElementChild; | |
mainblockNew.style.width = '100%'; | |
var rightblockNew = document.getElementsByClassName('flexrow app')[0].lastElementChild; | |
rightblockNew.remove(); | |
var links = document.getElementsByClassName('topfloat'); | |
for (var i = 0; i < links.length; i++) { | |
var a = links[i].getElementsByTagName('a'); | |
for (var j = 0; j < a.length; j++) { | |
var elem = a[j]; | |
elem.style.backgroundColor = 'var(--bg-bbtn)'; | |
} | |
} | |
} | |
(function () { | |
'use strict'; | |
setTimeout(removeAds, 1000); | |
})(); |
It's script for Tampermonkey but I don't use it long time so I don't know if it still works. Your feedback is welcome :)
It doesn't work
It doesn't work
You can try it now but there is still issue when you open canvas because this is calculated automatically
Hilariously, when I ran this script, it completely hid the UI and maximized the ads. Guessing the Photopea dev found this gist and didn't take too kindly to it ;)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How do you run this?