What it basically does:
window.addEventListener('resize', _ => window.innerWidth = window.outerWidth + 300);
Just pasting it into the Developer Tools console does not update it, just jiggle the border to trigger the recalc.
What it basically does:
window.addEventListener('resize', _ => window.innerWidth = window.outerWidth + 300);
Just pasting it into the Developer Tools console does not update it, just jiggle the border to trigger the recalc.
// ==UserScript== | |
// @name PhotoPea full width | |
// @namespace http://tampermonkey.net/ | |
// @version 1.1 | |
// @description Use full width - move the ad outside the viewport | |
// @author BananaAcid | |
// @match https://www.photopea.com/ | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=photopea.com | |
// @updateURL https://gist.github.com/BananaAcid/920a0af587367101a95a30c546d0162d/raw/PhotoPea%2520full%2520width.user.js | |
// @downloadURL https://gist.github.com/BananaAcid/920a0af587367101a95a30c546d0162d/raw/PhotoPea%2520full%2520width.user.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function addGlobalStyle(css = '') { | |
let target = (document.getElementsByTagName('head') || document.getElementsByTagName('body'))[0]; | |
let style = document.createElement('style'); | |
style.type = 'text/css'; | |
style.innerHTML = (css || arguments.length ? arguments[0][0] : '').replaceAll(';', ' !important;'); | |
target.appendChild(style); | |
} | |
let fn = _ => {window.innerWidth = window.outerWidth + 300}; | |
window.addEventListener('resize', fn); // worse because of app script being faster: , _ => requestAnimationFrame(fn)); | |
fn(); // initial = on page load | |
addGlobalStyle` | |
.topbar > button.fitem.bbtn { | |
position: relative; | |
top: -3em; | |
} | |
`; | |
})(); | |
To use or "install":