twitter 140 char highlighting

return 140 char highlighting to twitter

  1. // ==UserScript==
  2. // @name twitter 140 char highlighting
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description return 140 char highlighting to twitter
  6. // @author ashleyjames.xyz
  7. // @match https://twitter.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. var textdiv = document.getElementById('tweet-box-home-timeline');
  14. var otherdiv = document.getElementById('tweet-box-global');
  15. textdiv.onkeyup = function(){
  16. var str = textdiv.innerText;
  17. if (str.length > 140){
  18. textdiv.style.backgroundColor = "#faa";
  19. }
  20. else if (str.length <= 140){
  21. textdiv.style.backgroundColor = "#fff";
  22. }
  23. };
  24. otherdiv.onkeyup = function(){
  25. var otherstr = otherdiv.innerText;
  26. if (otherstr.length > 140){
  27. otherdiv.style.backgroundColor = "#faa";
  28. }
  29. else if (otherstr.length <= 140){
  30. otherdiv.style.backgroundColor = "#fff";
  31. }
  32. };
  33. })();

QingJ © 2025

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