🏠 Home 

Instagram Image Viewer

View the full image with the click of a button (or D key press).


Install this script?
  1. // ==UserScript==
  2. // @name Instagram Image Viewer
  3. // @namespace https://github.com/kittenparry/
  4. // @version 0.3
  5. // @description View the full image with the click of a button (or D key press).
  6. // @author kittenparry
  7. // @match https://www.instagram.com/p/*
  8. // @grant none
  9. // @license GPL-3.0-or-later
  10. // ==/UserScript==
  11. /* CHANGELOG:
  12. * 0.3: fix bad url timestamp error
  13. * 0.2.1: use a var to store img url to save those bytes in script file size
  14. * 0.2: fix the functionality | only gets the last image in image sets
  15. * 0.1: initial
  16. */
  17. window.addEventListener('load', () => {
  18. let img_url = document.querySelector('img[class="FFVAD"]').src;
  19. window.addEventListener('keydown', (e) => {
  20. var type = e.target.getAttribute('type');
  21. var tag = e.target.tagName.toLowerCase();
  22. if (type != 'text' && tag != 'textarea') {
  23. if (e.keyCode == 68) {
  24. window.location = img_url;
  25. }
  26. }
  27. }, false);
  28. document.querySelector('nav[class="NXc7H jLuN9 "]').innerHTML += '<a href="' + img_url + '" style="color: #7f8a94;"><div style="position: fixed; bottom: 50%; right: 0px; border-radius: 15px 0px 0px 15px; background: #faf0e6; padding: 13px; border: 2px solid #7f8a94; border-right-style: none;"><i style="border: solid black; border-width: 0 3px 3px 0; display: inline-block; padding: 3px; transform: rotate(45deg); -webkit-transform: rotate(45deg);"></i></div></a>';
  29. });