Created
September 19, 2016 18:18
-
-
Save e0da/e3908527f62b4d4dcb536eb47fa769ef to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name Hide Hangouts in Inbox | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Justin Force | |
// @match https://inbox.google.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var selectors = { | |
button: '[title=Hangouts][role=button]', | |
chatWindows: 'iframe[src^="https://hangouts.google.com"]' | |
}; | |
function hide(element) { | |
console.log(element); | |
element.style.opacity = 0; | |
element.style.pointerEvents = 'none'; | |
} | |
function hideChatWindows() { | |
document.querySelectorAll(selectors.chatWindows).forEach(function(iframe) { | |
hide(iframe); | |
}); | |
} | |
function hideButton() { | |
hide(document.querySelector(selectors.button).parentNode.parentNode); | |
} | |
function init() { | |
setInterval(function () { | |
hideButton(); | |
hideChatWindows(); | |
}, 500); | |
} | |
init(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment