Skip to content

Instantly share code, notes, and snippets.

@romw314
Last active June 18, 2024 16:00
Show Gist options
  • Save romw314/e1f7c562fb321f572b217bcb83ac99ba to your computer and use it in GitHub Desktop.
Save romw314/e1f7c562fb321f572b217bcb83ac99ba to your computer and use it in GitHub Desktop.
Show all images on a site. Be sure to scroll down and use the latest version!
// ==UserScript==
// @name SmImgShow
// @namespace http://tampermonkey.net/
// @version 2024-05-30
// @description Show all images on a site.
// @author romw314
// @match https://*/*
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAA9ElEQVR4Ae2WSRmEMAyFkYCESqiESkBCJPT0zpWChEpAAhIqAQWzz2S2EtL5MjeSY973k422Xc3gkZAx3T0jwXe/GggFx4oXUDss1GEv0NCCSzgqPGlx41smEf6lo/Et87EtuwW00ttFnSUCS2e4VZXDzLogAwvjelHXM7JIssjFus3WOC6ctvMj5Z7KOcILAjkBL883qoFRnDWy+D2pplwPT7dw12B34FQPzv8BLnZA85Jth2K/NvaLbf3rsaT9cDA+vswPWKMrgJ0sLylG6rPUOZlc9CAlUv8UUSP1j6V2pGQ7ckcO1shkgGMkA22QA9LZwwlNpFq6jAikkgAAAABJRU5ErkJggg==
// @grant none
// @sandbox DOM
// ==/UserScript==
(function() {
'use strict';
const imgShow = document.createElement('div');
imgShow.style.padding = '0';
imgShow.style.margin = '0';
imgShow.style.position = 'fixed';
imgShow.style.bottom = '0';
imgShow.style.right = '0';
imgShow.style.maxWidth = '50%';
imgShow.style.maxHeight = '70%';
imgShow.style.overflow = 'auto';
imgShow.style.zIndex = '131071';
imgShow.style.backgroundColor = 'lightgreen';
imgShow.style.border = '3px solid black';
imgShow.classList.add('smimgshow1', 'smimgshow1-container');
for (const img of document.querySelectorAll('img')) {
const smImg = document.createElement('img');
smImg.src = img.src;
smImg.width = 128;
smImg.height = 128;
smImg.style.padding = '0';
smImg.style.margin = '0';
smImg.classList.add('smimgshow1', 'smimgshow1-img');
smImg.addEventListener('click', () => {
const dialog = document.createElement('div');
dialog.style.position = 'fixed';
dialog.style.width = '70%';
dialog.style.height = '50%';
dialog.style.left = '50%';
dialog.style.top = '50%';
dialog.style.transform = 'translate(-50%,-50%)';
dialog.style.border = '3px solid black';
dialog.style.backgroundColor = 'lightgreen';
dialog.style.backgroundImage = 'url(' + img.src + ')';
dialog.style.zIndex = '131072';
dialog.classList.add('smimgshow1', 'smimgshow1-dialog');
const closeButton = document.createElement('button');
closeButton.innerHTML = '✖';
closeButton.style.position = 'relative';
closeButton.style.top = '20px';
closeButton.style.left = '20px';
closeButton.classList.add('smimgshow1', 'smimgshow1-close');
closeButton.addEventListener('click', () => document.body.removeChild(dialog));
dialog.appendChild(closeButton);
const urlDisplay = document.createElement('input');
urlDisplay.setAttribute('readonly', '1');
urlDisplay.style.width = '70%';
urlDisplay.value = img.src;
urlDisplay.style.position = 'relative';
urlDisplay.style.left = '50%';
urlDisplay.style.top = '50%';
urlDisplay.style.transform = 'translate(-50%,-50%)';
dialog.appendChild(urlDisplay);
document.body.appendChild(dialog);
});
imgShow.appendChild(smImg);
}
document.addEventListener('keydown', event => {
if (event.key === 'F2') {
event.preventDefault();
imgShow.style.display = imgShow.style.display === 'none' ? 'block' : 'none';
}
});
document.body.appendChild(imgShow);
})();
// ==UserScript==
// @name SmImgShow
// @namespace http://tampermonkey.net/
// @version 2024-05-31
// @description Show all images on a site.
// @author romw314
// @match http*://*/*
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAA9ElEQVR4Ae2WSRmEMAyFkYCESqiESkBCJPT0zpWChEpAAhIqAQWzz2S2EtL5MjeSY973k422Xc3gkZAx3T0jwXe/GggFx4oXUDss1GEv0NCCSzgqPGlx41smEf6lo/Et87EtuwW00ttFnSUCS2e4VZXDzLogAwvjelHXM7JIssjFus3WOC6ctvMj5Z7KOcILAjkBL883qoFRnDWy+D2pplwPT7dw12B34FQPzv8BLnZA85Jth2K/NvaLbf3rsaT9cDA+vswPWKMrgJ0sLylG6rPUOZlc9CAlUv8UUSP1j6V2pGQ7ckcO1shkgGMkA22QA9LZwwlNpFq6jAikkgAAAABJRU5ErkJggg==
// @grant none
// @sandbox DOM
// ==/UserScript==
(function() {
'use strict';
const imgShow = document.createElement('div');
imgShow.style.padding = '0';
imgShow.style.margin = '0';
imgShow.style.position = 'fixed';
imgShow.style.bottom = '0';
imgShow.style.right = '0';
imgShow.style.maxWidth = '50%';
imgShow.style.maxHeight = '70%';
imgShow.style.overflow = 'auto';
imgShow.style.zIndex = '131071';
imgShow.style.backgroundColor = 'lightgreen';
imgShow.style.border = '3px solid black';
imgShow.classList.add('smimgshow1', 'smimgshow1-container');
for (const img of document.querySelectorAll('img')) {
const smImg = document.createElement('img');
smImg.src = img.src;
smImg.width = 128;
smImg.height = 128;
smImg.style.padding = '0';
smImg.style.margin = '0';
smImg.classList.add('smimgshow1', 'smimgshow1-img');
smImg.addEventListener('click', () => {
const dialog = document.createElement('div');
dialog.style.position = 'fixed';
dialog.style.width = '70%';
dialog.style.height = '50%';
dialog.style.left = '50%';
dialog.style.top = '50%';
dialog.style.transform = 'translate(-50%,-50%)';
dialog.style.border = '3px solid black';
dialog.style.backgroundColor = 'lightgreen';
dialog.style.backgroundImage = 'url(' + img.src + ')';
dialog.style.zIndex = '131072';
dialog.classList.add('smimgshow1', 'smimgshow1-dialog');
const closeButton = document.createElement('button');
closeButton.innerHTML = '✖';
closeButton.style.position = 'relative';
closeButton.style.top = '20px';
closeButton.style.left = '20px';
closeButton.classList.add('smimgshow1', 'smimgshow1-close');
closeButton.addEventListener('click', () => document.body.removeChild(dialog));
dialog.appendChild(closeButton);
const urlDisplay = document.createElement('input');
urlDisplay.setAttribute('readonly', '1');
urlDisplay.style.width = '70%';
urlDisplay.value = img.src;
urlDisplay.style.position = 'relative';
urlDisplay.style.left = '50%';
urlDisplay.style.top = '50%';
urlDisplay.style.transform = 'translate(-50%,-50%)';
dialog.appendChild(urlDisplay);
document.body.appendChild(dialog);
});
imgShow.appendChild(smImg);
}
document.addEventListener('keydown', event => {
if (event.key === 'F2') {
event.preventDefault();
imgShow.style.display = imgShow.style.display === 'none' ? 'block' : 'none';
}
});
document.body.appendChild(imgShow);
})();
// ==UserScript==
// @name SmImgShow
// @namespace http://tampermonkey.net/
// @version 2024-06-18
// @description Show all images on a site.
// @author romw314
// @match http*://*/*
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAA9ElEQVR4Ae2WSRmEMAyFkYCESqiESkBCJPT0zpWChEpAAhIqAQWzz2S2EtL5MjeSY973k422Xc3gkZAx3T0jwXe/GggFx4oXUDss1GEv0NCCSzgqPGlx41smEf6lo/Et87EtuwW00ttFnSUCS2e4VZXDzLogAwvjelHXM7JIssjFus3WOC6ctvMj5Z7KOcILAjkBL883qoFRnDWy+D2pplwPT7dw12B34FQPzv8BLnZA85Jth2K/NvaLbf3rsaT9cDA+vswPWKMrgJ0sLylG6rPUOZlc9CAlUv8UUSP1j6V2pGQ7ckcO1shkgGMkA22QA9LZwwlNpFq6jAikkgAAAABJRU5ErkJggg==
// @grant none
// @sandbox DOM
// ==/UserScript==
(function() {
'use strict';
const imgShow = document.createElement('div');
imgShow.style.padding = '0';
imgShow.style.margin = '0';
imgShow.style.position = 'fixed';
imgShow.style.bottom = '0';
imgShow.style.right = '0';
imgShow.style.maxWidth = '50%';
imgShow.style.maxHeight = '70%';
imgShow.style.overflow = 'auto';
imgShow.style.zIndex = '131071';
imgShow.style.backgroundColor = 'lightgreen';
imgShow.style.border = '3px solid black';
imgShow.style.display = 'none';
imgShow.classList.add('smimgshow1', 'smimgshow1-container');
for (const img of document.querySelectorAll('img')) {
const smImg = document.createElement('img');
smImg.src = img.src;
smImg.width = 128;
smImg.height = 128;
smImg.style.padding = '0';
smImg.style.margin = '0';
smImg.classList.add('smimgshow1', 'smimgshow1-img');
smImg.addEventListener('click', () => {
const dialog = document.createElement('div');
dialog.style.position = 'fixed';
dialog.style.width = '70%';
dialog.style.height = '50%';
dialog.style.left = '50%';
dialog.style.top = '50%';
dialog.style.transform = 'translate(-50%,-50%)';
dialog.style.border = '3px solid black';
dialog.style.backgroundColor = 'lightgreen';
dialog.style.backgroundImage = 'url(' + img.src + ')';
dialog.style.zIndex = '131072';
dialog.classList.add('smimgshow1', 'smimgshow1-dialog');
const closeButton = document.createElement('button');
closeButton.innerHTML = '✖';
closeButton.style.position = 'relative';
closeButton.style.top = '20px';
closeButton.style.left = '20px';
closeButton.classList.add('smimgshow1', 'smimgshow1-close');
closeButton.addEventListener('click', () => document.body.removeChild(dialog));
dialog.appendChild(closeButton);
const urlDisplay = document.createElement('input');
urlDisplay.setAttribute('readonly', '1');
urlDisplay.style.width = '70%';
urlDisplay.value = img.src;
urlDisplay.style.position = 'relative';
urlDisplay.style.left = '50%';
urlDisplay.style.top = '50%';
urlDisplay.style.transform = 'translate(-50%,-50%)';
dialog.appendChild(urlDisplay);
document.body.appendChild(dialog);
});
imgShow.appendChild(smImg);
}
document.addEventListener('keydown', event => {
if (event.key === 'F2') {
event.preventDefault();
imgShow.style.display = imgShow.style.display === 'none' ? 'block' : 'none';
}
});
document.body.appendChild(imgShow);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment