hide all image tags on a page

Hide all image tags

当前为 2019-06-24 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name hide all image tags on a page
  3. // @namespace https://github.com/4ndr3wN/BrowserJavascripts/tree/master/hide_all_images
  4. // @version 0.1
  5. // @description Hide all image tags
  6. // @author 4ndr3wN@github
  7. // @match *://*/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var images = document.getElementsByTagName('img');
  15.  
  16. setImagesNone(images);
  17.  
  18. function setImagesNone(images){
  19. for (var img_k in images) {
  20. if (!images.hasOwnProperty(img_k)) continue;// skip loop if the property is from prototype
  21.  
  22. var image_v = images[img_k];
  23. image_v.style.display = "none";
  24. }
  25. }
  26. })();