Skip to content

Instantly share code, notes, and snippets.

@TheDcoder
Last active April 13, 2020 05:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheDcoder/b975882eae8d90815bf54de6182eccc9 to your computer and use it in GitHub Desktop.
Save TheDcoder/b975882eae8d90815bf54de6182eccc9 to your computer and use it in GitHub Desktop.
GOG Image Hunter
// ==UserScript==
// @name GOG Image Hunter
// @namespace Violentmonkey Scripts
// @match https://email2.gog.com/view.html
// @noframes
// @grant GM_setClipboard
// @run-at document-start
// @version 1.1
// @author TheDcoder
// @description Started work on 12/4/2020, 8:04:15 PM
// ==/UserScript==
document.addEventListener("keydown", event => {
if (!event.ctrlKey || !event.shiftKey || event.key.toLowerCase() != 'c') return;
event.stopPropagation();
event.preventDefault();
var images = document.querySelectorAll('table.background td > a > img');
var urls = []
for (let image of images) urls.push(image.parentNode.href);
GM_setClipboard(urls.join('\n'));
alert(`Copied ${urls.length} URL(s) to clipboard`);
});
alert("GOG Image Hunter is active, use Ctrl+Shift+C to copy all URLs");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment