Skip to content

Instantly share code, notes, and snippets.

@aarongarciah
Last active July 11, 2019 10:47
Show Gist options
  • Save aarongarciah/2cb0016c8e198ae87b2340b8c31c768c to your computer and use it in GitHub Desktop.
Save aarongarciah/2cb0016c8e198ae87b2340b8c31c768c to your computer and use it in GitHub Desktop.
Hide Google Calendar Event Names
(function() {
var nodes = document.querySelectorAll('[data-eventchip]');
Array.from(nodes).forEach(elem => {
var inner = elem.querySelector('[aria-hidden="true"]');
if (!inner) return;
var children = inner.childNodes;
Array.from(children).forEach(child => {
if (window.eventNamesHidden) {
var oldText = child.dataset['oldText'];
if (oldText) child.textContent = oldText;
} else {
child.dataset['oldText'] = child.textContent;
child.textContent = '';
}
});
});
window.eventNamesHidden = !Boolean(window.eventNamesHidden);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment