Created
August 14, 2015 14:37
-
-
Save vancura/3fb86fdc5cd6eb47aa3f to your computer and use it in GitHub Desktop.
This file contains 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== | |
// @name Dribbble 2x | |
// @namespace http://vancura.org | |
// @description Use 2x images | |
// @homepage http://vancura.org | |
// @version 0.0.1 | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js | |
// @include *://dribbble.com/* | |
// ==/UserScript== | |
var f; | |
var src, fn, ext; | |
var loop = setInterval(dribbbleLoop, 1000); | |
function dribbbleLoop() { | |
$(".dribbble-img img").each(function() { | |
t = $(this); | |
src = t.attr("src"); | |
if(src.indexOf('_1x.') > 0) { | |
fn = src.substr(0, src.length - 7); | |
ext = src.substr(src.length - 3, 3); | |
src = fn + "." + ext; | |
t.after("<img src='" + src + "' />"); | |
t.hide(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment