-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreplaceshift.js
More file actions
25 lines (24 loc) · 869 Bytes
/
Copy pathreplaceshift.js
File metadata and controls
25 lines (24 loc) · 869 Bytes
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
(function() {
'use strict';
const link = document.createElement('link');
link.href = 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap';
link.rel = 'stylesheet';
document.head.appendChild(link);
const style = document.createElement('style');
style.textContent = `
* {
font-family: 'Roboto', sans-serif !important;
}
`;
document.head.appendChild(style);
const observer = new MutationObserver((mutations) => {
for (const mutation of mutations) {
for (const node of mutation.addedNodes) {
if (node.nodeType === 1) {
node.style.fontFamily = "'Roboto', sans-serif";
}
}
}
});
observer.observe(document.body, { childList: true, subtree: true });
})();