Skip to content

Instantly share code, notes, and snippets.

@Matyanson
Last active April 4, 2022 21:24
Show Gist options
  • Save Matyanson/82ab6fcef3297297f4b20cc9d7dfa07e to your computer and use it in GitHub Desktop.
Save Matyanson/82ab6fcef3297297f4b20cc9d7dfa07e to your computer and use it in GitHub Desktop.
r/place collab script
// ==UserScript==
// @name r/place collab
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the canvas!
// @author Matyanson
// @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', async () => {
const links = [
'https://i.imgur.com/WpWRIJt.png'
]
const images = [];
for(let link of links) {
const i = document.createElement("img");
i.src = link;
i.onload = () => {
i.style = "position: absolute;left: 0;top: 0;image-rendering: pixelated;width: 2000px;height: 2000px;";
};
images.push(i);
}
const placeCanvas = document.getElementsByTagName("mona-lisa-embed")[0].shadowRoot.children[0].getElementsByTagName("mona-lisa-canvas")[0].shadowRoot.children[0];
for(let img of images) {
placeCanvas.appendChild(img);
}
}, false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment