Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- @licstart The following is the entire license notice for the JavaScript code in this page.
- This software is intended to restore freedoms to users that were taken by Gelbooru's use of crippleware proprietary scripts.
- RenKoloader - Copyright (C) 2017 CommonJunko
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- @licend The above is the entire license notice for the JavaScript code in this page.
- */
- // ==UserScript==
- // @name RenKoloader
- // @namespace http://tampermonkey.net/
- // @version 1.1
- // @description Restores the user's freedoms
- // @author CommonJunko
- // @match http://gelbooru.com/*
- // @grant none
- // ==/UserScript==
- //WARNING: using this script can effectively double your data consumption. It is not reccomended to use this on a mobile or metered connection.
- (function() {
- "use strict";
- function loadItem(){
- //Find the link to the highres image
- var originalImageDom = document.getElementsByTagName('a');
- var originalImageDomItem;
- for (let i = 0; i < originalImageDom.length; i++){
- if (originalImageDom.item(i).text == "Original image"){
- originalImageDomItem = originalImageDom.item(i);
- break;
- }
- }
- //Find the antiadblock text
- var textWhere = document.getElementsByTagName('br');
- var textHere;
- var nsaKeywords = /(adblock)|(javascript)/gi;
- const MinaMo = 5;
- for (let i = 0; i < textWhere.length; i++){
- if (nsaKeywords.test(textWhere.item(i).text)){
- textHere = textWhere.item(i);
- break;
- }
- }
- //Delete that g-dawful and obnoxious video
- var isVideo = !!(document.getElementById("gelcomVideoPlayer")); //PROTIP for you JS devs out there: the double bang (!!) will return ONLY true/false
- if(isVideo){
- var itemCountainer = document.getElementById("gelcomVideoPlayer");
- itemCountainer.outerHTML = "";
- }
- //Insert the iframe
- var fir = document.createElement('iframe');
- var originalURL = originalImageDomItem.href;
- fir.setAttribute('id', 'fir');
- fir.setAttribute('sandbox', 'allow-same-origin');
- fir.setAttribute('src', originalURL);
- fir.style.position = "relative";
- fir.style.height = "75em";
- fir.style.width = "75%";
- var mexicans = document.getElementById('right-col');
- mexicans.parentNode.insertBefore(fir, mexicans);
- //Find the image that may or may not have shown up
- var isImage = !!(document.getElementById("image"));
- if (isImage){
- var nImageCountainer = document.getElementById("image");
- nImageCountainer.style.display = "none";
- }
- }
- loadItem();
- // window.onload = loadItem; //you should only need that if your script injector is a little stupid
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement