-
Notifications
You must be signed in to change notification settings - Fork 1
/
TrendingMrow.js
53 lines (46 loc) · 1.6 KB
/
TrendingMrow.js
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
48
49
50
51
52
53
// ==UserScript==
// @name "Trending Mrow" on Twitter
// @author Stephen Chapman - Twitter: @Chapman | GitHub: dsasmblr
// @version 0.1
// @description See what's Trending Mrow instead of Trending Now!
// @match *://*.twitter.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
const setMrow = () => {
const trendingNow = document.querySelector('[aria-label="Timeline: Trending now"]');
if (trendingNow) {
trendingNow.parentElement.innerHTML = `
<h2 style="
color: white;
font: 20px -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
font-weight: 800;
padding-left: 16px;
">
Trending mrow
</h2>
<div style="
align-items: center;
display: flex;
height: 205px;
justify-content: center;
">
<a href="https://twitter.com/Chapman/status/1617296455584346113" style="padding-right: 15px;" target="_blank">
<img src="https://pbs.twimg.com/media/FnHGpl6XoAEMn5M.png" style="max-width: 100%;" />
</a>
</div>
`;
}
}
const t = document.body;
const c = { childList: true, subtree: true };
const cb = (mutList, obs) => {
mutList.forEach((mut) => {
setMrow();
});
};
const obs = new MutationObserver(cb);
obs.observe(t, c);
})();