-
Notifications
You must be signed in to change notification settings - Fork 0
/
bookmarklet.txt
20 lines (8 loc) · 1.5 KB
/
bookmarklet.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Below are the bookmarklets that allow sending your current web page link in Google Chrome to an email address.
Before using, replace [email protected] with your gmail address (optional) and
replace [email protected] with the address you want to send the email to.
Then create a bookmark in Chrome's Bookmark Bar with the desired code (e.g. the line that starts with "javascript").
Version of Bookmarklet that auto closes window:
javascript:(function(){var t = document.title.trim(); var ind = t.indexOf("- [email protected]"); var ts = ind > 0 ? t.substring(0,ind) : t; var te = encodeURIComponent(ts); var sel = window.getSelection().toString().trim(); if (sel.length > 0) {sel = "\n\n" + sel + "\n";} var n = encodeURIComponent(ts+"\n"+"\n"+top.document.location.href+sel); var w = window.open("mailto:[email protected]?subject="+te+"&body="+n,"_blank","toolbar=0,location=0,menubar=0,height=348,width=840"); setTimeout(()=>{w.close();}, 1000);})(); void(0);
Version of Bookmarklet that keeps window open:
javascript:(function(){var t = document.title.trim(); var ind = t.indexOf("- [email protected]"); var ts = ind > 0 ? t.substring(0,ind) : t; var te = encodeURIComponent(ts); var sel = window.getSelection().toString().trim(); if (sel.length > 0) {sel = "\n\n" + sel + "\n";} var n = encodeURIComponent(ts+"\n"+"\n"+top.document.location.href+sel); var w = window.open("mailto:[email protected]?subject="+te+"&body="+n,"_blank","toolbar=0,location=0,menubar=0,height=348,width=840"); })(); void(0);