Skip to content

Instantly share code, notes, and snippets.

@ZenithRogue
Created October 17, 2018 23:14
Show Gist options
  • Save ZenithRogue/700218f9a33f0d8159c54c982e20a778 to your computer and use it in GitHub Desktop.
Save ZenithRogue/700218f9a33f0d8159c54c982e20a778 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name IMG fixer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @author You
// @match https://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var body = document.getElementsByTagName('body')[0];
var baseURL = "https://yt3-zenithknight.c9users.io/b64/?url=";
var images = $("img");
var x=0;
var grabby;
while(x<images.length) {
grabby = baseURL + images[x].src;
var newIMG;
$.get(grabby, function(data) {
//alert(data);
newIMG = "http://kindersay.com/files/images/hamburger.png";
});
$("img")[x].src = newIMG;
//images[x].src = "http://kindersay.com/files/images/hamburger.png";
x++;
}
// Your code here...
})();
@sirhypernova
Copy link

// ==UserScript==
// @name         image fixer
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        *://*/*
// @grant        none
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';
    var images = $('img');
    var base = 'https://zv3.herokuapp.com/b64/?url=';
    for (var key in images) {
        let image = images[key];
        let src = image.src;
        //console.log(src);]
        if (src == undefined) continue;
        if (src.startsWith('data:image/')) return;
        $.get(base + src,(data) => {
            //$(image).attr('src',data);
            image.src = data;
            //console.log(image.src);
        });
    }
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment