Open F-Droid Images in New Tab

Open F-Droid images in a new tab when clicked

  1. // ==UserScript==
  2. // @name Open F-Droid Images in New Tab
  3. // @namespace https://github.com/AbdurazaaqMohammed/userscripts
  4. // @author Abdurazaaq Mohammed
  5. // @version 1.0
  6. // @description Open F-Droid images in a new tab when clicked
  7. // @match https://f-droid.org/*/packages/*
  8. // @run-at document-start
  9. // @grant none
  10. // @license The Unlicense
  11. // @homepage https://github.com/AbdurazaaqMohammed/userscripts
  12. // @supportURL https://github.com/AbdurazaaqMohammed/userscripts/issues
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. const images = document.querySelectorAll('.js_slide.screenshot');
  18.  
  19. for (let i = 0; i < images.length; i++) {
  20. images[i].addEventListener('click', function(e) {
  21. e.preventDefault();
  22. window.open(this.querySelector('img').src, '_blank');
  23. });
  24. }
  25. })();