Skip to content

Instantly share code, notes, and snippets.

@recih
Created November 21, 2015 09:27
Show Gist options
  • Select an option

  • Save recih/6bf9748e8d2530f14240 to your computer and use it in GitHub Desktop.

Select an option

Save recih/6bf9748e8d2530f14240 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Feedbin skip image proxy
// @namespace recih
// @version 0.1
// @description make feedbin load image faster
// @match https://feedbin.com/
// @grant none
// @copyright 2014+, recih
// ==/UserScript==
(function()
{
function init()
{
// select the target node
var target = document.querySelector('div.entry-content-wrap');
// create an observer instance
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
for(var i = 0; i < mutation.addedNodes.length; i++)
{
$("img[data-canonical-src]", mutation.addedNodes[i]).each(function()
{
this.src = $(this).data("canonical-src");
});
}
});
});
// configuration of the observer:
var config = { attributes: false, childList: true, characterData: false }
// pass in the target node, as well as the observer options
observer.observe(target, config);
}
$(document).ready(init);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment