Created
October 18, 2015 01:14
-
-
Save autioch/7e468e310f80e5bc3400 to your computer and use it in GitHub Desktop.
Longest CSS rule in the page
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
(function(j, w) { | |
w.call(document.styleSheets).forEach(function(q) { | |
try { /* Accessing remote domain cssRules fails. */ | |
w.call(q.rules || q.cssRules).forEach(function(k) { | |
(k.selectorText || '').split(',').forEach(function(b) { | |
(b.length > j.length) && (j = b); | |
}); | |
}); | |
} catch (z) {} | |
}); | |
return j; | |
})('', [].slice); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment