twitter 140 char highlighting

return 140 char highlighting to twitter

当前为 2017-11-08 提交的版本,查看 最新版本

// ==UserScript==
// @name         twitter 140 char highlighting
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  return 140 char highlighting to twitter
// @author       ashleyjames.xyz
// @match        https://twitter.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var textdiv = document.getElementById('tweet-box-home-timeline');
    textdiv.onkeyup = function(){
        var str = textdiv.innerHTML;
        if (str.length > 140){
            textdiv.style.backgroundColor = "#faa";
        }
        else if (str.length < 140){
            textdiv.style.backgroundColor = "#fff";
        }
    };
})();