-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreplacelogo.js
More file actions
30 lines (25 loc) · 1.29 KB
/
Copy pathreplacelogo.js
File metadata and controls
30 lines (25 loc) · 1.29 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
(function() {
'use strict';
const selectors = [
'#__next > div > main > div > div > div > aside > div > div.overflow-hidden.transition-all.ease-out.duration-300.hidden.lg\\:block.max-w-64.translate-x-0 > div > div > div.grid.items-center.w-full.grid-cols-2.pt-6.pl-6 > a > div > svg',
'#__next > div > main > div > div > div > aside > div > div.flex.w-screen.h-dvh > div.absolute.top-0.z-10.w-64.h-full.border-r.border-r-accent.bg-primary-foreground > div > div > div > div.grid.items-center.w-full.grid-cols-2.pt-6.pl-6 > a > div'
];
function replaceLogo() {
selectors.forEach(selector => {
const target = document.querySelector(selector);
if (target && !target.dataset.replaced) {
const img = document.createElement('img');
img.src = 'https://characterai.io/static/logo-variants/text-logo-dark.png';
img.style.width = '100%';
img.style.height = 'auto';
target.replaceWith(img);
img.dataset.replaced = "true";
}
});
}
const observer = new MutationObserver(() => {
replaceLogo();
});
observer.observe(document.body, { childList: true, subtree: true });
replaceLogo();
})();