2016-09-01 56 views
0

いくつかのURLを生成して開く短く簡潔なブックマークレットを作成する方法は?Yesterbox - 現在の日付のURLを生成して開くJavascript Bookmarklet

たとえば、現在の日付(ブラウザのタイムゾーン)を含むurlを生成して開きます。

これは参考になります。 (Gmailのような)いくつかのウェブベースの電子メールクライアントのためにyesterboxを実装するプレフィルフォームまたはブックマークレットにURLを作るには?

のはユーザーでログインしてGmailの最初の/デフォルト/ 0のための1つを作ってみましょう、ここにURLが日付である:「前+:日付」追加

https://mail.google.com/mail/u/0/#search/is%3Ainbox+before%3A2016-08-31 
# or "priority inbox" 
https://mail.google.com/mail/u/0/#search/is%3Ainbox+is%3Aimportant+before%3A2016-08-31 

答えて

0

ブックマークレットcourrent URLに=あなたがGmailの上でそれを検索した場合現在の検索に「前:YYYY-MM-DD」を追加します!だからあなたはあなたが使っている各検索クエリによってyesterboxを行うことができます! (単に「ラベル: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()); })(); 

そしてここでは、バージョンは、現在のトンで開放されていますAB /ウィンドウhttps://www.mattcutts.com/blog/javascript-bookmarklet-basics/

:基準

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 */ 

参照 "を主演" と

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 */ 

関連する問題