|
// ==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(); |