Skip to content

Instantly share code, notes, and snippets.

@ZenithRogue
Last active October 19, 2018 19:30
Show Gist options
  • Save ZenithRogue/5c77dcfbc1275c79f180c52cc6d531f6 to your computer and use it in GitHub Desktop.
Save ZenithRogue/5c77dcfbc1275c79f180c52cc6d531f6 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Image Replacer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Replaces all images with base64
// @author You
// @match https://*/*
// @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 current = images[key];
let src = current.src;
//console.log(src);]
if (src == undefined) continue;
if (src.startsWith('data:image/')) return;
$.get(base + src,(data) => {
//$(current).attr('src',data);
current.src = data;
//current.attr('onerror', "this.src=http://kindersay.com/files/images/hamburger.png");
//console.log(current.src);
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment