Skip to content

Instantly share code, notes, and snippets.

@e0da
Created September 19, 2016 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e0da/e3908527f62b4d4dcb536eb47fa769ef to your computer and use it in GitHub Desktop.
Save e0da/e3908527f62b4d4dcb536eb47fa769ef to your computer and use it in GitHub Desktop.
// ==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