Skip to content

Instantly share code, notes, and snippets.

@sash13
Created April 28, 2013 18:41
Show Gist options
  • Select an option

  • Save sash13/5477930 to your computer and use it in GitHub Desktop.

Select an option

Save sash13/5477930 to your computer and use it in GitHub Desktop.
Simple Google Plus comments cleaner
// ==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);
Copy link
Copy Markdown

ghost commented May 8, 2013

Hm. Looks like schoolboy coding style, sorry.

@mvasilkov
Copy link
Copy Markdown

@MaximRussia Tsumugi is obviously a girl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment