Greasy Fork is available in English.

Twitter Uncrop Images

Remove the image cropping on the timeline view.

  1. // ==UserScript==
  2. // @name Twitter Uncrop Images
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Remove the image cropping on the timeline view.
  6. // @author Cro
  7. // @match https://*.twitter.com/*
  8. // @match https://*.x.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. setInterval(function()
  15. {
  16. for (let node of document.querySelectorAll('div[data-testid="tweetPhoto"], div[data-testid="videoPlayer"]'))
  17. {
  18. node.style.marginLeft = "";
  19. node.style.marginTop = "";
  20. node.style.marginBottom = "";
  21. node.style.marginRight = "";
  22. node.children[0].style.backgroundSize = "contain";
  23. node.children[0].style.backgroundPosition = "";
  24. }
  25.  
  26. for (let node of document.querySelectorAll('article [class="r-1adg3ll r-13qz1uu"]'))
  27. {
  28. node.style.paddingBottom = "100%";
  29. }
  30.  
  31. // Get rid of the rounded corners.
  32. for (let node of document.querySelectorAll('article .r-1867qdf'))
  33. {
  34. node.classList.remove('r-1867qdf');
  35. }
  36. }, 500);
  37. })();