Last active
April 13, 2020 05:44
-
-
Save TheDcoder/b975882eae8d90815bf54de6182eccc9 to your computer and use it in GitHub Desktop.
GOG Image Hunter
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 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