Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wenLiangcan
Forked from johan/manifest.json
Created March 4, 2014 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wenLiangcan/9345331 to your computer and use it in GitHub Desktop.
Save wenLiangcan/9345331 to your computer and use it in GitHub Desktop.
{ "name": "Tumblr full size images"
, "version": "1.0"
, "description": "Never show image thumbnails on tumblr"
, "homepage_url": "https://gist.github.com/johan/6336414"
, "manifest_version": 2
, "content_scripts":
[ { "js":
[ "tumblr-full-size-images.user.js"
]
, "matches":
[ "http://*.tumblr.com/*"
]
}
]
}
// ==UserScript==
// @version 1.0
// @name Tumblr full size images
// @description Never show image thumbnails on tumblr
// @namespace https://github.com/johan
// @match http://*.tumblr.com/*
// @match https://*.tumblr.com/*
// ==/UserScript==
var changes, _slice = [].slice, changes;
function array(ish) { return _slice.call(ish, 0); }
function $$(sel, ctx) { return array((ctx || document).querySelectorAll(sel)); }
function click(e) { if (e && typeof e.click === 'function') e.click(); }
function update() {
if (changes) changes.disconnect();
else changes = new MutationObserver(update);
$$('img[data-full-size]:not(.enlarged)').forEach(click);
changes.observe(document.body, { childList: true, subtree: true });
}
update();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment