Last active
April 6, 2022 20:17
-
-
Save adryzz/75b13e695d164f1f75de1d620ca8881f to your computer and use it in GitHub Desktop.
r/place canvas downloader
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 r/place canvas downloader | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description download the r/place canvas | |
// @author adryzz | |
// @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', () => { | |
//wait for everything to load | |
setTimeout(() => { | |
//get the help button | |
document.getElementsByTagName("mona-lisa-embed")[0].shadowRoot.children[0].children[0].children[3].children[1].shadowRoot.children[0].shadowRoot.children[0].onclick = function(){ | |
//get the canvas | |
var canvas = document.getElementsByTagName("mona-lisa-embed")[0].shadowRoot.children[0].getElementsByTagName("mona-lisa-canvas")[0].shadowRoot.children[0].children[0]; | |
var dataURL = canvas.toDataURL("image/png"); | |
var a = document.createElement('a'); | |
a.href = dataURL; | |
a.download = "place.png"; | |
document.body.appendChild(a); | |
a.click(); | |
}}, 10000); | |
}, false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how i can run this script?