F**kElonMusk - twitter.com

7/24/2023 17:48

  1. // ==UserScript==
  2. // @name F**kElonMusk - twitter.com
  3. // @namespace Violentmonkey Scripts
  4. // @match https://twitter.com/*
  5. // @run-at document-start
  6. // @homepage https://twitter.com/
  7. // @grant none
  8. // @version 2.0
  9. // @author none
  10. // @license MIT
  11. // @description 7/24/2023 17:48
  12. // ==/UserScript==
  13. const preloadStyle = new CSSStyleSheet();
  14. preloadStyle.replaceSync(`
  15. a[aria-label="Twitter"] > div {
  16. visibility: hidden!important;
  17. }
  18. #placeholder > svg {
  19. display: none!important;
  20. }
  21. `);
  22. const imgSrc = "data:image/svg+xml,%3Csvg width='500' height='500' viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'%3E%3Ctitle%3Etwitter-logo%3C/title%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M170.2264 442.7654c162.2648 0 251.0168-140.0367 251.0168-261.4758 0-3.9775 0-7.9371-.258-11.8788 17.2659-13.009 32.1701-29.1167 44.0148-47.5687-16.1013 7.4318-33.1817 12.3057-50.6712 14.4587 18.4168-11.4849 32.2005-29.5486 38.786-50.8295-17.3177 10.7044-36.2637 18.2483-56.0204 22.3062-27.3466-30.29-70.8-37.7036-105.9942-18.0837-35.194 19.62-53.3763 61.3941-44.351 101.8979-70.9346-3.7043-137.0242-38.6047-181.8212-96.0154-23.4157 41.9903-11.4554 95.7083 27.3136 122.6754-14.0397-.4335-27.7732-4.3786-40.0416-11.5025v1.1646c.0115 43.7452 29.6141 81.4229 70.778 90.085-12.9882 3.6897-26.6156 4.229-39.8352 1.5766 11.5575 37.4355 44.6783 63.0807 82.4224 63.8192-31.2398 25.5748-69.831 39.4584-109.564 39.4166A172.495 172.495 0 0 1 35 401.4854c40.345 26.9696 87.2885 41.275 135.2264 41.2083' fill='%231DA1F2'/%3E%3Cpath d='M35 35h430v430H35z'/%3E%3C/g%3E%3C/svg%3E%0A";
  23. const bgStyle = size => `
  24. background-image: url("${imgSrc}");
  25. background-size: ${size};
  26. background-repeat: no-repeat;
  27. background-position: center;
  28. `;
  29.  
  30. document.adoptedStyleSheets = [preloadStyle];
  31. window.addEventListener('DOMContentLoaded', () => {
  32. const loadingEl = document.getElementById('placeholder');
  33. if (loadingEl) {
  34. loadingEl.innerHTML = '';
  35. const blueBird = document.createElement('div');
  36. blueBird.style.cssText = `
  37. width: 72px;
  38. height: 72px;
  39. position: absolute;
  40. top: 0;
  41. bottom: 0;
  42. right: 0;
  43. left: 0;
  44. margin: auto;
  45. ${bgStyle('90%')}
  46. `;
  47. loadingEl.appendChild(blueBird);
  48. }
  49. const hdr = setInterval(() => {
  50. const logoXpath = document.evaluate('//*[@id="react-root"]/div/div/div[2]/header/div/div/div/div[1]/div[1]/h1/a/div', document.body, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  51. if (logoXpath?.snapshotLength) {
  52. const logoEl = logoXpath.snapshotItem(0);
  53. logoEl.innerHTML = '';
  54. logoEl.style.cssText = bgStyle('80%');
  55. preloadStyle.replaceSync('');
  56. clearInterval(hdr);
  57. }
  58. }, 100);
  59. });

QingJ © 2025

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