Skip to content

Instantly share code, notes, and snippets.

@MDFL64
Created April 4, 2022 16:55
Show Gist options
  • Save MDFL64/c1fda08a6c5ce199f431dfe27c2c203c to your computer and use it in GitHub Desktop.
Save MDFL64/c1fda08a6c5ce199f431dfe27c2c203c to your computer and use it in GitHub Desktop.
Wandering / Star Trek Overlay
// ==UserScript==
// @name Wandering / Star Trek Overlay
// @namespace http://tampermonkey.net/
// @version 0.3
// @description try to take over the canvas!
// @author cogg + Mikarific + probably stolen from someone else
// @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', () => {
// Load the image
const image = document.createElement("img");
const time = Date.now();
image.src = "https://tmp.bz/dotted_mind_goblin_normalized.png?time=" + time;
image.onload = () => {
image.style = `position: absolute; left: 1852px; top: 372px; width: ${image.width/3}px; height: ${image.height/3}px; image-rendering: pixelated; z-index: 1`;
};
// Add the image as overlay
const camera = document.querySelector("mona-lisa-embed").shadowRoot.querySelector("mona-lisa-camera");
const canvas = camera.querySelector("mona-lisa-canvas");
canvas.shadowRoot.querySelector('.container').appendChild(image);
}, false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment