Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Google Logo Remover - Hides the logo on the Google homepage because it changes too much
// ==UserScript==
// @name Google Logo Remover
// @description Hides the logo on the Google homepage because it changes too much
// @version 1.1
// @namespace nutbread
// @include https://google.com/*
// @include https://*.google.com/*
// @grant none
// @run-at document-start
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAn0lEQVR42u3awQ1AQBhEYdkiJFrRDQc9aEgbTnShDCdhzZ/sQQdMPMm7z5es024VXzcdSTVqVJu6VP5YV9k2lq3pOb5Vi8omLWVzCkCtZnUaAc6yuQ7AoLJpQwBWY8AagN0YsAcgOwcAAAAAAAAAAAAAwIuA3nh8zxECAICfmCMEAAAAAAAAAAAA4McA+0s++2tW+4tu+6cG9o897J/b3Ajk5Evv30bKAAAAAElFTkSuQmCC
// ==/UserScript==
// Main
(function () {
"use strict";
// Run when the document is ready
var on_ready = (function () {
// Vars
var callbacks = [],
check_interval = null,
check_interval_time = 250;
// Check if ready and run callbacks
var callback_check = function () {
if (
(document.readyState === "interactive" || document.readyState === "complete") &&
callbacks !== null
) {
// Run callbacks
var cbs = callbacks,
cb_count = cbs.length,
i;
// Clear
callbacks = null;
for (i = 0; i < cb_count; ++i) {
cbs[i].call(null);
}
// Clear events and checking interval
window.removeEventListener("load", callback_check, false);
window.removeEventListener("readystatechange", callback_check, false);
if (check_interval !== null) {
clearInterval(check_interval);
check_interval = null;
}
// Okay
return true;
}
// Not executed
return false;
};
// Listen
window.addEventListener("load", callback_check, false);
window.addEventListener("readystatechange", callback_check, false);
// Callback adding function
return function (cb) {
if (callbacks === null) {
// Ready to execute
cb.call(null);
}
else {
// Delay
callbacks.push(cb);
// Set a check interval
if (check_interval === null && callback_check() !== true) {
check_interval = setInterval(callback_check, check_interval_time);
}
}
};
})();
// Setup as soon as possible
on_ready(function () {
var node;
if ((node = document.querySelector("#lga")) !== null) {
node.style.visibility = "hidden";
}
if ((node = document.querySelector("#gbq1")) !== null) {
node.style.visibility = "hidden";
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment