Make bluebird great again

Twitter's bluebird is better than 𝕏

  1. // ==UserScript==
  2. // @name Make bluebird great again
  3. // @namespace TypeNANA
  4. // @version 0.10
  5. // @description Twitter's bluebird is better than 𝕏
  6. // @author You
  7. // @match *://*.twitter.com/*
  8. // @match *://twitter.com/*
  9. // @match *://*.x.com/*
  10. // @match *://x.com/*
  11. // @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
  12. // @require http://code.jquery.com/jquery-3.3.1.min.js
  13. // @grant none
  14. // @license MIT
  15. // ==/UserScript==
  16.  
  17. (function() {
  18. waitForKeyElements(
  19. 'a[aria-label="X"]',
  20. makeBlueBirdGreatAgain
  21. );
  22. waitForKeyElements(
  23. 'div[data-testid="TopNavBar"]',
  24. makeBlueBirdGreatAgain
  25. );
  26. changeFavIcon();
  27.  
  28. function changeFavIcon(){
  29. let v = $('link[rel="shortcut icon"]');
  30. if (v == null || v.length == 0) return;
  31. v[0].setAttribute("href", 'https://abs.twimg.com/favicons/twitter.ico');
  32. }
  33.  
  34. function makeBlueBirdGreatAgain(v){
  35. if (v == null || v.length == 0) return;
  36. v[0].getElementsByTagName("path")[0].setAttribute("d", 'M23.643 4.937c-.835.37-1.732.62-2.675.733.962-.576 1.7-1.49 2.048-2.578-.9.534-1.897.922-2.958 1.13-.85-.904-2.06-1.47-3.4-1.47-2.572 0-4.658 2.086-4.658 4.66 0 .364.042.718.12 1.06-3.873-.195-7.304-2.05-9.602-4.868-.4.69-.63 1.49-.63 2.342 0 1.616.823 3.043 2.072 3.878-.764-.025-1.482-.234-2.11-.583v.06c0 2.257 1.605 4.14 3.737 4.568-.392.106-.803.162-1.227.162-.3 0-.593-.028-.877-.082.593 1.85 2.313 3.198 4.352 3.234-1.595 1.25-3.604 1.995-5.786 1.995-.376 0-.747-.022-1.112-.065 2.062 1.323 4.51 2.093 7.14 2.093 8.57 0 13.255-7.098 13.255-13.254 0-.2-.005-.402-.014-.602.91-.658 1.7-1.477 2.323-2.41z')
  37. }
  38.  
  39. function waitForKeyElements(
  40. selectorTxt,
  41. actionFunction,
  42. bWaitOnce,
  43. iframeSelector
  44. ) {
  45. var targetNodes, btargetsFound;
  46.  
  47. if (typeof iframeSelector == "undefined") {
  48. targetNodes = $(selectorTxt);
  49. } else {
  50. targetNodes = $(iframeSelector).contents().find(selectorTxt);
  51. }
  52.  
  53. if (targetNodes && targetNodes.length > 0) {
  54. btargetsFound = true;
  55. targetNodes.each(function () {
  56. var jThis = $(this);
  57. var alreadyFound = jThis.data('alreadyFound') || false;
  58.  
  59. if (!alreadyFound) {
  60. var cancelFound = actionFunction(jThis);
  61. if (cancelFound) {
  62. btargetsFound = false;
  63. } else {
  64. jThis.data('alreadyFound', true);
  65. }
  66. }
  67. });
  68. } else {
  69. btargetsFound = false;
  70. }
  71.  
  72. var controlObj = waitForKeyElements.controlObj || {};
  73. var controlKey = selectorTxt.replace(/[^\w]/g, "_");
  74. var timeControl = controlObj[controlKey];
  75.  
  76. if (btargetsFound && bWaitOnce && timeControl) {
  77. clearInterval(timeControl);
  78. delete controlObj[controlKey]
  79. } else {
  80. if (!timeControl) {
  81. timeControl = setInterval(function () {
  82. waitForKeyElements(selectorTxt,
  83. actionFunction,
  84. bWaitOnce,
  85. iframeSelector
  86. );
  87. }, 300);
  88. controlObj[controlKey] = timeControl;
  89. }
  90. }
  91. waitForKeyElements.controlObj = controlObj;
  92. }
  93. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址