Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ==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
You can’t perform that action at this time.