Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name E-hentai Fullscreen Viewer
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Fullscreen pictures on g.e-hentai.org. Use left and right arrows to navigate.
- // @author patchwerk
- // @match https://e-hentai.org/s/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var link = document.querySelectorAll("#i3 > a > img");
- var body = document.querySelectorAll("body");
- var sni = document.querySelectorAll(".sni");
- var sn = document.querySelectorAll(".sn a")[1].getAttribute("href");
- var ifd = document.querySelectorAll(".if");
- var tod = document.querySelectorAll(".tod");
- var picto = document.querySelectorAll(".sn");
- var sb = document.querySelectorAll(".sb");
- var ip = document.querySelectorAll(".ip");
- body = body[0];
- sni = sni[0];
- link = link[0];
- var oldHeight = link.offsetHeight;
- var href = document.querySelectorAll(".sni > #i3 > a");
- fullscreen();
- function fullscreen() {
- if (ifd[0] != null) {
- ifd[0].style.display = "none";
- }
- if (tod[0] != null) {
- tod[0].style.display = "none";
- }
- picto[0].style.display = "none";
- picto[1].style.display = "none";
- sb[0].style.display = "none";
- ip[0].style.display = "none";
- body.style.backgroundColor = "#E3E0D1";
- body.style.color = "#E3E0D1";
- sni.style.backgroundColor = "#E3E0D1";
- sni.style.border = "1px solid #E3E0D1";
- link.style.position = "fixed";
- link.style.top = "0";
- link.style.bottom = "0";
- link.style.left = "0";
- link.style.right = "0";
- link.style.width = "";
- link.style.height = "100%";
- link.style.margin = "auto";
- link.style.overflow = "auto";
- link.style.zoom = "10";
- link.style.zIndex = "100";
- }
- document.onkeydown = checkKey;
- function checkKey(e) {
- console.log('ok');
- e = e || window.event;
- if (e.keyCode == '37') {
- window.location.href = sn;
- } else if (e.keyCode == '39') {
- window.location.href = href[0].getAttribute("href");
- } else if (e.keyCode == '27') {
- if (ifd[0] != null) {
- ifd[0].style.display = "block";
- }
- if (tod[0] != null) {
- tod[0].style.display = "block";
- }
- picto[0].style.display = "block";
- picto[1].style.display = "block";
- sb[0].style.display = "block";
- ip[0].style.display = "block";
- body.style.backgroundColor = "#E3E0D1";
- body.style.color = "#5C0D11";
- sni.style.backgroundColor = "#EDEBDF";
- sni.style.border = "1px solid #5C0D12";
- link.style.position = "";
- link.style.top = "";
- link.style.bottom = "";
- link.style.left = "";
- link.style.right = "";
- link.style.width = "";
- link.style.height = oldHeight;
- link.style.margin = "";
- link.style.overflow = "";
- link.style.zoom = "";
- link.style.zIndex = "";
- } else if (e.keyCode == '32') {
- fullscreen();
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment