-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNitter.user.js
More file actions
60 lines (51 loc) · 2.05 KB
/
Nitter.user.js
File metadata and controls
60 lines (51 loc) · 2.05 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
48
49
50
51
52
53
54
55
56
57
58
59
60
// ==UserScript==
// @name Nitter Tweaks
// @namespace Violentmonkey Scripts
// @include https://nitter.net/*
// @include https://n.asak.gg/*
// @grant none
// @version 1.0
// @author Daniel Crooks
// @description UI Tweaks to clean up Nitter
// ==/UserScript==
console.log("Nitter Mods Loading...");
function changeText() {
document.body.style.fontFamily = "Atkinson Hyperlegible";
}
function changeBorder() {
const timelineDivs = document.querySelectorAll('.timeline>div:not(:first-child)');
timelineDivs.forEach(div => { div.style.borderTop = '5px solid var(--bg_color)'; });
}
function changeHeaderIcon() {
document.querySelector("body > nav > div > div:nth-child(1) > a").innerText = "🐦"; // "nitter" to bird emoji
let username = "";
try {
username = document.querySelector("body > div > div > div.profile-tab.sticky > div.profile-card > div.profile-card-info > div > a.profile-card-username").innerText;
} catch (err) {
console.error("Username not found.");
}
document.querySelector("body > nav > div > a").innerHTML = username;
}
function changeSuspensionMessage() {
try {
var statusText = document.querySelector("body > div > div > div > span").innerText;
var accountUnavailableRegex= /User ".*?" not found/;
if (statusText == 'User "" has been suspended') {
document.querySelector("body > div > div > div > span").innerText = "Account Suspended.";
} else if (statusText == 'Tweet not found') {
document.querySelector("body > div > div > div > span").innerText = "Tweet Deleted.";
} else if (accountUnavailableRegex.test(statusText)) {
document.querySelector("body > div > div > div > span").innerText = "Account Unavailable.";
}
} catch (err) {
//console.error("User not Suspended.");
}
}
function changeSearchBar() {
document.querySelector(".search-bar > form").style.background = "#000";
}
changeText();
changeBorder();
changeHeaderIcon();
changeSuspensionMessage();
changeSearchBar();