Created
April 28, 2013 18:41
-
-
Save sash13/5477930 to your computer and use it in GitHub Desktop.
Simple Google Plus comments cleaner
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 hidePlusKomrads | |
| // @description Script to hide comments | |
| // @author Tsumugi Kotobuki | |
| // @license MIT | |
| // @version 0.01 | |
| // @include https://plus.google.com/* | |
| // ==/UserScript== | |
| (function (window, undefined) { | |
| var w; | |
| if (typeof unsafeWindow != undefined) { | |
| w = unsafeWindow | |
| } else { | |
| w = window; | |
| } | |
| if(document.getElementsByClassName) { | |
| getElementsByClass = function(classList, node) { | |
| return (node || document).getElementsByClassName(classList) | |
| } | |
| } else { | |
| getElementsByClass = function(classList, node) { | |
| var node = node || document, | |
| list = node.getElementsByTagName('*'), | |
| length = list.length, | |
| classArray = classList.split(/\s+/), | |
| classes = classArray.length, | |
| result = [], i,j | |
| for(i = 0; i < length; i++) { | |
| for(j = 0; j < classes; j++) { | |
| if(list[i].className.search('\\b' + classArray[j] + '\\b') != -1) { | |
| result.push(list[i]) | |
| break | |
| } | |
| } | |
| } | |
| return result | |
| } | |
| } | |
| sec = function() { | |
| var div = document.getElementById("contentPane") | |
| elements = getElementsByClass('Se Eu', div) | |
| for (var i = 0; i < elements.length; i++) { | |
| if(elements[i].style.cssText == '') { | |
| elements[i].setAttribute('style', 'display: none;'); | |
| } | |
| } | |
| } | |
| if (w.self != w.top) { | |
| return; | |
| } | |
| if (/https:\/\/plus.google.com/.test(w.location.href)) { | |
| sec(); | |
| setInterval(sec, 2000); | |
| } | |
| })(window); |
@MaximRussia Tsumugi is obviously a girl.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hm. Looks like schoolboy coding style, sorry.