-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHideYammerThreads.js
More file actions
37 lines (30 loc) · 1.2 KB
/
Copy pathHideYammerThreads.js
File metadata and controls
37 lines (30 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// ==UserScript==
// @name HideYammerThreads
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Hide Yammer threads
// @author Gregory-William FLAMANT
// @match https://www.yammer.com/{MyOrganization}/
// ==/UserScript==
(function() {
'use strict';
setInterval(function() {
let childToRemove = [];
let threadListItems = document.getElementsByClassName('yj-thread-list-item');
if(threadListItems !== undefined && threadListItems.length > 0) {
const parentNode = threadListItems[0].parentElement;
// Insert here the groups to ignore.
const excludedThreads = ["Dev Group", "Group HR"];
for(let thread of threadListItems) {
const threadTextValue = thread.childNodes[0].outerText;
const isExcludedThread = excludedThreads.find( excludedThread => threadTextValue.includes(excludedThread));
if(isExcludedThread !== undefined) {
childToRemove.push(thread);
}
}
for(let thread of childToRemove) {
parentNode.removeChild(thread);
}
}
}, 3000);
})();