Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name NoGIF
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @author You
- // @match http://tampermonkey.net/changelog.php?version=3.12.58&ext=dhdg&updated=true&old=3.8.52&intr=true
- // @grant none
- // @include http://www.neogaf.com/forum/*
- // ==/UserScript==
- /* jshint -W097 */
- 'use strict';
- var hide=document.createElement("input");
- hide.type="button";
- hide.value="Hide Gif";
- hide.onclick = hideGif;
- hide.setAttribute("style", "font-size:18px;position:absolute;top:205px;right:40px;");
- var unhide=document.createElement("input");
- unhide.type="button";
- unhide.value="Unhide Gif";
- unhide.onclick = unhideGif;
- unhide.setAttribute("style", "font-size:18px;position:absolute;top:205px;right:150px;");
- var threadTitle = document.getElementsByName("keywords");
- if(threadTitle[0].content.indexOf("COMICS!") >= 0)
- {
- document.body.appendChild(hide);
- document.body.appendChild(unhide);
- var as = document.getElementsByTagName("img");
- hide.click();
- }
- function unhideGif()
- {
- for(var i=0;i<as.length;i++)
- {
- var cls = as[i];
- if((cls.src.indexOf(".gif") >=0) || (cls.src.indexOf(".GIF") >=0))
- {
- cls.removeAttribute("style",";display:none;");
- }
- }
- }
- function hideGif()
- {
- for(var i=0;i<as.length;i++)
- {
- var cls = as[i];
- if((cls.src.indexOf(".gif") >=0) || (cls.src.indexOf(".GIF") >=0))
- {
- cls.setAttribute("style",";display:none;");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment