Created
March 13, 2010 04:31
-
-
Save satyr/331107 to your computer and use it in GitHub Desktop.
mailto (for Thunderbird etc.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: 'mailto', | |
argument: noun_arb_text, | |
execute: function({object: {text}}){ | |
var {title, URL} = CmdUtils.getDocument(); | |
Utils.currentChromeWindow.gBrowser.loadURIWithFlags( | |
'mailto:'+ encodeURIComponent(text) + Utils.paramsToString({ | |
subject: "'"+ title +"'", | |
//body: URL +'\n\n'+ CmdUtils.getSelection(), | |
'html-body': ((<><a href={URL}>{URL}</a><br/><br/></>) + | |
CmdUtils.getHtmlSelection()), | |
}).slice(0, 2e3), // trim to avoid exception | |
''); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment