ZirconiumX

Untitled

Nov 27th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Twitter
  3. // @version 1.0
  4. // @author byuu
  5. // @include https://twitter.com/*
  6. // @grant none
  7. // @run-at document-start
  8. // ==/UserScript==
  9.  
  10. //about:config
  11. //[string] general.useragent.override.twitter.com = "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
  12.  
  13. var themed = 0;
  14.  
  15. (function() {
  16. const allowCopyAndPaste = function(e) {
  17. e.stopImmediatePropagation();
  18. return true;
  19. };
  20. document.addEventListener('copy', allowCopyAndPaste, true);
  21. document.addEventListener('paste', allowCopyAndPaste, true);
  22. })();
  23.  
  24. function allowInlineTweets() {
  25. var domain = ".twitter.com";
  26. var expiryDate = new Date(-1).toUTCString();
  27. document.cookie = "rweb_optin=; domain=" + domain + "; path=/; expires=" + expiryDate;
  28. }
  29.  
  30. function applyTheme() {
  31. if(themed == 1) return;
  32. var stylesheet = window.document.styleSheets[0];
  33. if(!stylesheet) return;
  34. themed = 1;
  35. var style = document.createElement("style");
  36. style.type = "text/css";
  37. style.innerText = "" +
  38. "* { border-radius: 0em !important; } " + //revert circular avatars
  39. ".Banner { display: none !important; } " + //remove bloat
  40. ".topbar-spacer { padding-top: 45px !important; } " + //remove "deprecated browser" prompt
  41. ".wtf-module { display: none !important; } " + //remove "who to follow"
  42. ".WtfLargeCarouselStreamItem { display: none !important; } " + //remove inline "who to follow"
  43. ".Footer { display: none !important; } " + //remove bloat
  44. ".Trends { display: none !important; } " + //remove trends
  45. ".stream-tombstone-container { display: none !important; } " + //remove "blocked/muted tweet" indicator
  46. ".tooltip { display: none !important; } " + //remove annoying tooltips that tend to not go away
  47. ".DelightOptInModule { display: none !important; } " + //remove "new twitter" prompt
  48. "";
  49. document.head.appendChild(style);
  50. }
  51.  
  52. function main() {
  53. applyTheme();
  54. allowInlineTweets();
  55. }
  56.  
  57. main();
  58. var timer = setInterval(main, 50);
Add Comment
Please, Sign In to add comment