Last active
August 18, 2021 11:11
-
-
Save DesertEagleDerek/afa3281b951b4b05c27422aa2ff104ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Twitter un-circle | |
// @namespace https://gist.githubusercontent.com/DesertEagleDerek/afa3281b951b4b05c27422aa2ff104ee/raw/Twitter_Uncircle.user.js | |
// @updateURL https://gist.githubusercontent.com/DesertEagleDerek/afa3281b951b4b05c27422aa2ff104ee/raw/Twitter_Uncircle.user.js | |
// @downloadURL https://gist.githubusercontent.com/DesertEagleDerek/afa3281b951b4b05c27422aa2ff104ee/raw/Twitter_Uncircle.user.js | |
// @version 0.9 | |
// @author DesertEagleDerek | |
// @description Revert to older square elements | |
// @homepage http://www.deserteaglederek.com/ | |
// @match https://twitter.com/* | |
// @run-at document-start | |
// @grant none | |
// ==/UserScript== | |
function addGlobalStyle(css) { | |
var head, style; | |
head = document.getElementsByTagName('head')[0]; | |
if (!head) { return; } | |
style = document.createElement('style'); | |
style.type = 'text/css'; | |
style.innerHTML = css; | |
head.appendChild(style); | |
} | |
function addStyleCSS(values) { | |
var finalCSS = ""; | |
for(var i = 0; i < values.length; i++) { | |
for(var j = 0; j < values[i].length; j++) { | |
if(j > 0) { | |
finalCSS += values[i][j] + " !important;"; | |
} else { | |
finalCSS += values[i][j] + " { "; | |
} | |
} | |
finalCSS += " } \n"; | |
} | |
addGlobalStyle(finalCSS); | |
} | |
(function() { | |
'use strict'; | |
// array | |
var cssArray = []; | |
// get rid of those circles! (pre-2019 layout) | |
cssArray.push([".Avatar, .ProfileAvatar-image", "border-radius:8px"]); | |
cssArray.push([".ProfileAvatar", "border-radius:12px"]); | |
cssArray.push([".ProfileCard-avatarLink", "border-radius:6px"]); | |
cssArray.push([".ProfileCard-avatarLink img", "border-radius:5px"]); | |
cssArray.push([".DashboardProfileCard-avatarImage", "border-radius:5px"]); | |
cssArray.push([".avatar", "border-radius:5px"]); | |
cssArray.push([".EdgeButton", "border-radius:5px"]); | |
cssArray.push(["#tweet-box-global", "padding:5px"]); | |
cssArray.push([".RichEditor", "border-radius:5px"]); | |
cssArray.push([".tweet-content", "margin-bottom:16px"]); | |
cssArray.push([".dropdown-toggle", "border-radius:8px"]); | |
cssArray.push([".dropdown-toggle:before", "border-radius:8px"]); | |
cssArray.push([".Gallery-media", "border-radius:6px"]); | |
cssArray.push([".ProfileCardMini-avatarImage", "border-radius:4px"]); | |
cssArray.push([".DMAvatar", "border-radius:4px"]); | |
cssArray.push([".avatar--circular", "border-radius:4px"]); | |
// get rid of those circles! (2019 layout) | |
cssArray.push([".r-sdzlij", "border-radius:4px"]); | |
// add style to page | |
addStyleCSS(cssArray); | |
})(); |
Aha! "Document Body" seems to have fixed it for now. My "stress test" is to open 10+ new tabs (by, say, mass opening people's profiles from my geed) and then checking once loaded to see whether the elements are circles or squares. I will keep testing and see whether that remains the case. Thanks a lot!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've experienced this a few times but not recently. I use Google Chrome and more often use TweetDeck rather than Twitter itself and it never seems to happen on there. Whenever I witnessed this behaviour, it seemed to be when the site was taking too long to load. One thing you can try is in the header section of the script, change the run-at from document-start to one of the other accepted values. You can find a description of the values at the link below.
https://www.tampermonkey.net/documentation.php#_run_at