Created
November 30, 2010 18:02
-
-
Save mjball/722082 to your computer and use it in GitHub Desktop.
Fixes imgur gallery's broken zoom feature in chrome
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== | |
// @name Fix Imgur Gallery | |
// @namespace http://mjball.github.com | |
// @description Fixes imgur gallery's broken zoom feature in chrome - no longer needed! | |
// @include http://imgur.com/gallery/* | |
// @include http://www.imgur.com/gallery/* | |
// ==/UserScript== | |
// No longer needed! | |
var styleSheets = document.styleSheets, | |
i = styleSheets.length, | |
styleSheet, | |
rules, | |
j, | |
rule; | |
while (i--) | |
{ | |
styleSheet = styleSheets[i]; | |
if (styleSheet.href && styleSheet.href.slice(-15) === 'jquery.zoom.css') | |
{ | |
rules = styleSheet.rules; | |
j = rules.length; | |
while (j--) | |
{ | |
rule = rules[j]; | |
if (rule.selectorText === 'div.jquery-image-zoom img, div.jquery-image-zoom embed, div.jquery-image-zoom object, div.jquery-image-zoom div') | |
{ | |
rule.style.cssText = ''; | |
break; | |
} | |
} | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment