Skip to content

Instantly share code, notes, and snippets.

@xyzzyy
Created April 2, 2022 20:02
Show Gist options
  • Save xyzzyy/b634a86f04ee6f9379b5b9b764558236 to your computer and use it in GitHub Desktop.
Save xyzzyy/b634a86f04ee6f9379b5b9b764558236 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name r/fairytail place template
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the canvas!
// @author oralekin, LittleEndu
// @match https://hot-potato.reddit.com/embed*
// @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
// @grant none
// ==/UserScript==
if (window.top !== window.self) {
window.addEventListener('load', () => {
document.getElementsByTagName("mona-lisa-embed")[0].shadowRoot.children[0].getElementsByTagName("mona-lisa-canvas")[0].shadowRoot.children[0].appendChild(
(function () {
const i = document.createElement("img");
i.src = "https://i.imgur.com/NPMuSMO.png";
i.onload = () => {
if (i.width === i.height) {
i.style = "position: absolute;left: 0;top: 0;image-rendering: pixelated;width: 1000px;height: 1000px;";
} else {
i.style = "position: absolute;left: 0;top: 0;image-rendering: pixelated;width: 2000px;height: 1000px;";
}
};
return i;
})())
}, false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment