Created
August 29, 2012 05:07
-
-
Save jr-codes/3507032 to your computer and use it in GitHub Desktop.
Google Calendar Tasks Killer
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 Google Calendar Tasks Killer | |
// @namespace http://zarjay.net/ | |
// @description Removes the "Tasks" item from the "My Calendar" section of Google Calendar | |
// @match https://www.google.com/calendar/* | |
// @version 1.0 | |
// ==/UserScript== | |
// Removes the "Tasks" item from "My Calendar" | |
function killTasks() { | |
var tasksLabel = document.getElementById('label-dGFza3NAdGFza3MuZ29vZ2xlLmNvbQ'); | |
if (tasksLabel) tasksLabel.parentNode.style.display = 'none'; | |
} | |
// Waits for synchronous code to finish executing before calling killTasks() | |
function asyncKillTasks() { | |
setTimeout(killTasks, 0); | |
} | |
function init() { | |
// Kill Tasks! | |
killTasks(); | |
// Google Calendar will try to bring Tasks back every time you select | |
// a calendar. This will make sure it stays hidden. | |
var myCalendars = document.getElementById('calendars_my'); | |
if (myCalendars) myCalendars.addEventListener('mousedown', asyncKillTasks); | |
var otherCalendars = document.getElementById('calendars_fav'); | |
if (otherCalendars) otherCalendars.addEventListener('mousedown', asyncKillTasks); | |
} | |
// Wait a bit before executing (Google Calendar needs some time to load) | |
setTimeout(init, 1500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment