User:TheDavidJ/testdonotinstall.js

// ==UserScript== // @name        Wikipedia Image Hider // @namespace   your-namespace // @version     1.0 // @description Hides Wikipedia images until a button is pressed to unhide or hide them all. // @match       https://en.wikipedia.org/* // @grant       none // ==/UserScript==

(function {   'use strict';

// Create the "Unhide All" button var unhideButton = document.createElement("button"); unhideButton.innerHTML = "Unhide All"; unhideButton.style.marginRight = "10px"; unhideButton.addEventListener("click", function {       var images = document.querySelectorAll("img");        for (var i = 0; i < images.length; i++) {            images[i].style.display = "block";        }    });

// Create the "Hide All" button var hideButton = document.createElement("button"); hideButton.innerHTML = "Hide All"; hideButton.addEventListener("click", function {       var images = document.querySelectorAll("img");        for (var i = 0; i < images.length; i++) {            images[i].style.display = "none";        }    });

// Add the buttons to the top of the page var header = document.getElementById("firstHeading"); header.insertBefore(unhideButton, header.firstChild); header.insertBefore(hideButton, header.firstChild); });