-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogo.user.js
More file actions
47 lines (37 loc) · 1.22 KB
/
Copy pathlogo.user.js
File metadata and controls
47 lines (37 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// ==UserScript==
// @name frosted google logo
// @namespace http://tromoSM.com/
// @version 1.3
// @description tromoSM - Frosted google logo
// @match https://www.google.com/*
// @grant none
// ==/UserScript==
(function () {
'use strict';
const imageURL = 'https://github.com/tromoSM/Frosted-google/blob/main/tromoSM-Google-logo-better-custom-spaced.png?raw=true';
const observer = new MutationObserver(() => {
const logoLink = document.getElementById('logo');
if (!logoLink) return;
const existingImg = logoLink.querySelector('img');
const existingSVG = logoLink.querySelector('svg');
if (existingImg?.src.includes('tromoSM-Google-logo.png')) {
return;
}
if (existingSVG) existingSVG.remove();
const img = document.createElement('img');
img.src = imageURL;
img.alt = 'tromoSM Google Logo';
img.style.height = '24px';
img.style.objectFit = 'contain';
img.style.display = 'block';
img.style.filter = 'none';
img.style.webkitFilter = 'none';
img.style.imageRendering = 'auto';
logoLink.appendChild(img);
observer.disconnect();
});
observer.observe(document.body, {
childList: true,
subtree: true
});
})();