小书签,增加了“+前:日期”到courrent URL =如果您在Gmail搜索它将在当前搜索中添加“之前:YYYY-MM-DD”!因此,您可以通过您使用的每个搜索查询来执行“ (注意只用“标签:X”的查询,因为它们形成URL不同)
/* Current View!!! (Adds "before:YYYY-MM-DD" to current URL ! -> gmail search view) */
javascript:(function(){ var d=new Date(); var curr=location.href; location.replace(curr+'+before:'+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()); })(); /* http://stackoverflow.com/a/29808878 */
小书签开放新标签/新窗口与before:
组与容易采用当前日期
javascript:(function(){ var d=new Date(); window.open('https://mail.google.com/mail/u/0/#search/is:inbox+before:'+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()); })();
“是:重要”或‘是:不重要’:
javascript:(function(){ var d=new Date(); window.open('https://mail.google.com/mail/u/0/#search/is:inbox+is:important+before:'+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()); })();
javascript:(function(){ var d=new Date(); window.open('https://mail.google.com/mail/u/0/#search/is:inbox+is:unimportant+before:'+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()); })();
这里是版本电流T 开幕AB /窗口:
javascript:(function(){ var d=new Date(); location.replace('https://mail.google.com/mail/u/0/#search/is:inbox+is:unimportant+before:'+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()); })(); /* http://stackoverflow.com/a/29808878 */
javascript:(function(){ var d=new Date(); location.replace('https://mail.google.com/mail/u/0/#search/is%3Ainbox+is%3Aimportant+before:'+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()); })(); /* http://stackoverflow.com/a/29808878 */
并且还与 “出演” 标准
javascript:(function(){ var d=new Date(); location.replace('https://mail.google.com/mail/u/0/#search/is:inbox+is:unimportant+-is:starred+before:'+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()); })(); /* http://stackoverflow.com/a/29808878 */
javascript:(function(){ var d=new Date(); location.replace('https://mail.google.com/mail/u/0/#search/is%3Ainbox+(is%3Aimportant+OR+is%3Astarred)+before:'+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()); })(); /* http://stackoverflow.com/a/29808878 */
参考文献:https://www.mattcutts.com/blog/javascript-bookmarklet-basics/