1

GM 脚本:GMail 日期正常化

 2 years ago
source link: https://blog.lilydjwg.me/2014/3/9/gm-script-friendly-date-display.43374.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

GM 脚本:GMail 日期正常化

本文来自依云's Blog,转载请注明。

我所谓的「正常化」,就是适合人而不是机器读取的格式啦。比如你们说「12/2/14」这是哪天呢……明明可以显示成「20YY年M月DD日 上午H:MM」这样子的(鼠标移过去会出现),但是为什么非要我去移鼠标呢。于是就有了这个很简单的脚本:

gmail_date.user.js
// ==UserScript==
// @name           GMail 日期正常化
// @namespace      http://lilydjwg.is-programmer.com/
// @description    将 GMail 中的日期使用更适合人阅读的形式显示
// @include        https://mail.google.com/*
// @grant      none
// ==/UserScript==
var doit = function(){
var elements = document.querySelectorAll('span[alt]');
for(var i=0, len=elements.length; i<len; i++){
elements[i].textContent = elements[i].getAttribute('alt');
}
};
document.addEventListener('overflow', doit);
window.addEventListener('focus', doit);

点此安装

发送到 Kindle


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK