Skip to content

Instantly share code, notes, and snippets.

@1v
Created January 28, 2018 07:05
Show Gist options
  • Save 1v/424adda8f9004e9e621a23c1be290830 to your computer and use it in GitHub Desktop.
Save 1v/424adda8f9004e9e621a23c1be290830 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Gmail Icon
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://mail.google.com/*
// @grant none
// @require http://code.jquery.com/jquery-3.2.1.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// ==/UserScript==
(function() {
'use strict';
waitForKeyElements('link[rel="icon"]', change_icon);
function change_icon(node){
var link = node.attr('href');
node.attr('href', link.replace(/-b/, ''));
}
})();
@shellscape
Copy link

Or like, if you don't want to load jquery for absolutely no reason on the page...

document.addEventListener('DOMContentLoaded', (event) => {
  const link = document.querySelector('link[rel=icon]');
  const href = link.getAttribute('href');

  link.setAttribute('href', href.replace('-b', '_2x'));
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment