Bl4Cc4t / GoodTwitter2

Userscript to modify the looks of twitter.com
497 stars 63 forks source link

Add option to remove the "Profile box" in the top left corner the website #562

Open EmerickDaniel opened 1 year ago

EmerickDaniel commented 1 year ago

By default the script places a box with the basic stats of the profile you're using, but that's not something I want to be seeing all the time. Here's the box in question, highlighted in red: __1Screenshot 2023-07-08 at 01-59-24 Home _ Twitter

I tried messing with the script and found out the function responsible for this lies between lines 131-144 of the script, that by default goes as follows: if (user) { info = { bannerUrl: user.profile_banner_url, avatarUrl: user.profile_image_url_https, screenName: user.screen_name, name: user.name, id: user.id_str, stats: { tweets: user.statuses_count, followers: user.followers_count, following: user.friends_count } }

I tried tweaking the values until I got to the following code: if (user) { info = { bannerUrl:null, avatarUrl: null, screenName: "NoOne", name: "NoOne", id: null, stats: { tweets: "Not that many", followers: "Some people", following: "Some other people", } }

By messing around with those values I managed to get rid of the "Profile Box", making the website looking as this: Screenshot 2023-07-08 at 02-03-09 Home _ Twitter

I'm not a proficient coder in any langue, I just know some basic programming and scripting, hence why I went with a method so crude. I went from commenting out the entire functions (some of which kinda worked?) to pinpointing the function that handled that specific box. There's sure a better way to implement this this feature, maybe even as a togglable option in the settings, but I'm not currently the most capable person to implement this feature, so I hope someone with more knowledge can do a better/cleaner job. I'm also new to github and code contribution in general, so if I posted this in the wrong place, or wasn't clear enough with my explanation, I apologize in advance, and wish whoever is handling this a good day!