-
-
Save wenLiangcan/9345331 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "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/*" | |
] | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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