Gmail Compose Extension - HELP NEEDED

Talk about add-ons and extension development.
gdeka
Posts: 79
Joined: April 25th, 2003, 1:24 am
Location: Australia
Contact:

Gmail Compose Extension - HELP NEEDED

Post by gdeka »

I am writing an extension to automatically open the gmail compose window.
What i was wondering is how to make it cross platform (i use linux but am developing on a windows machine atm)
the network.protocol-handler.app.mailto does not seem to work on windows
i have not tried this in linux but i understand it will work
User avatar
mai9
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona
Contact:

Post by mai9 »

will this extension open the compose window when clicking on a mailto:// link? (in this case the extension is great :)
User avatar
roachfiend
Posts: 264
Joined: December 7th, 2002, 11:54 pm
Location: north america

Post by roachfiend »

this program will do what you want, mai9:

http://www.rabidsquirrel.net/G-Mailto/
User avatar
Rowne Mastaile
Posts: 1434
Joined: December 21st, 2003, 3:05 pm
Location: Housed in a swirling neosma of scintillating thought and turgid ideas.
Contact:

Post by Rowne Mastaile »

Is it possible to parse a javascript command (with an embedded URL) through Firefox via the command line? Much like -url except for a Javascript call itself.

If that's the case then one could alter the mail/shell/bla RegEdit key to point to the Firefox.exe itself and GMail could work that way without an Exe. Just a thought that occured to me, as I'd read a similar treatise on the GMail-To boards as to how one would do this with IE a little bit back.
TheOneKEA
Posts: 4864
Joined: October 16th, 2003, 5:47 am
Location: Somewhere in London, riding the Underground

Post by TheOneKEA »

Slightly OT: how does one make a Linux build of Firefox open Thunderbird when clicking on a mailto: link?
Proud user of teh Fox of Fire
Registered Linux User #289618
User avatar
polidobj
Posts: 3147
Joined: March 31st, 2004, 9:10 am
Location: Maryland USA - im in ur tinderbox, crashtesting ur firefox

Post by polidobj »

roachfiend wrote:this program will do what you want, mai9:

http://www.rabidsquirrel.net/G-Mailto/


Damm why can't there be a yahoo mail user who wants this feature enough to do something similar? ](*,)
Brian J Polidoro - Today's bugs brought to you by Raid. :P
Windows7 - Firefox user since ~Feb 2002
gdeka
Posts: 79
Joined: April 25th, 2003, 1:24 am
Location: Australia
Contact:

Post by gdeka »

yes it will do exactly what g-mailto does - however i wish to make it as an extension that is cross platfrom as i run linux.

Offtopic -
To make firefox open mailto links in thunderbird on linux
MozillaFirefox (and Firebird) don't have a working mailto handler out of the box, but this can be fixed by changing the network.protocol-handler.app.mailto setting. Its value should be the path to a helper script. The setting may not show up in about:config -- in that case, you have to place a line like

user_pref("network.protocol-handler.app.mailto", "/path/to/helper-script.sh");

in the user.js file in your profile directory. (or use about:config)

In either case, you have to restart MozillaFirefox for the setting to take effect.

Here's a helper script which invokes MozillaThunderbird:

#!/bin/bash
thunderbird -remote 'ping()' || exec thunderbird "$@" # exec thunderbird if there's no instance running
thunderbird -remote "xfeDoCommand(openInbox)" # otherwise raise window,
[ "${1%%:*}" = 'mailto' ] && thunderbird -remote "mailto(${1#mailto:})" # and maybe send the mailto:


That should help.
User avatar
erwan
Posts: 112
Joined: March 26th, 2003, 6:40 pm
Location: Mountain View, CA
Contact:

Post by erwan »

I tried to look in the Launchy code to do that, but Launchy is a bit too big and complicated to just extract the useful code section...
http://erwan.jp/vgspy: dashboard about video games.
http://moji.mozdev.org: integrated Japanese dictionary for Firefox.
jedbro
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.
Contact:

Post by jedbro »

Done!

GmailCompose for Firefox 0.9.

It seems to work great, although the code is messy, I just grabed bits and peices of code I have from different extensions I've made and threw it together.
Let me know if it works for you, I based it off of G-Mailto's instructions.

A "Gmail Compose" link apears in the context menu when you hover over a mailto: link.

Cheers

-Jed

*EDIT*
I must have skimmed through this thread, this is called via the context menu only, it doesn't work for left-clicking mailto:links.

To get that done, I assume you could add a listener when over a mailto:link (gContextMenu.onMailtoLink)
then call the extensions function.

If you want I can do this, but first, please let me know if it works for you (on win and linux) as I am unable to boot into linux during the week (only weekends).
Stauf
Posts: 1
Joined: June 23rd, 2004, 11:54 pm

Post by Stauf »

Using User Script 0.3 from MonkeeSage - http://forums.mozillazine.org/viewtopic.php?t=81591

My userScript.js looks like:

Code: Select all

function GMailmailto(){
   var x,i,a;
   var url = 'https://gmail.google.com/?dest=https%253A%252F%252Fgmail%252Egoogle%252Ecom%252Fgmail%253Fview%253Dpage%2526name%253Dcompose%2526cmid%253D0%2526fs%253D1%2526tearoff%253D1%2526to%253D';
   x=document.links;
   for(i=0;i<x.length;++i) {
      if (x[i].protocol=='mailto:') {
         a = x[i].toString();
         a = a.substring(7, alen);
         a = encodeURIComponent(a);
         a = a.replace(/%/g, '%25');
         a = url+a;
         x[i].href = a;
      }
   }
}

GMailmailto();


Replaces all mailto: links with a link to the GMail compose window. The code can be made into a bookmarklet easily enough (which was what it was initially meant to be). And it's platform independent.
-- Bob.
User avatar
Rowne Mastaile
Posts: 1434
Joined: December 21st, 2003, 3:05 pm
Location: Housed in a swirling neosma of scintillating thought and turgid ideas.
Contact:

Post by Rowne Mastaile »

- jedbro

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040621 Solarphoenix/0.9.0+ (Firefox/0.9.0+ rebrand)

Perfectly functional for me! I'd love to see a left-click variant. Could the above code from Stauf simply be dropped in?
kstahl
Moderator
Posts: 1521
Joined: December 22nd, 2003, 5:27 pm
Location: Stockholm, Sweden

Post by kstahl »

Very nice, Jed. I'd love to see more Gmail extensions.

One thing I've wanted for some time is an extension of the
Send Page... functionality. Something to automatically send the link to a predefined email adress with a single click.

Using the Gmail functions above it wouldn't need an external SMTP server.
User avatar
roachfiend
Posts: 264
Joined: December 7th, 2002, 11:54 pm
Location: north america

Post by roachfiend »

polidobj wrote:
roachfiend wrote:this program will do what you want, mai9:

http://www.rabidsquirrel.net/G-Mailto/


Damm why can't there be a yahoo mail user who wants this feature enough to do something similar? ](*,)
there is, it's just hard to find.

the following link downloads a .CAB file (ymmapi.cab) containing ymmapi.dll and ymmapi.inf. the .cab file can be extracted with WinZip, and the .dll can be registered by right-clicking on the .inf file and selecting "install".

http://download.yahoo.com/dl/mail/ymmapi.cab
jedbro
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.
Contact:

Post by jedbro »

Roan Foofitush wrote: I'd love to see a left-click variant. Could the above code from Stauf simply be dropped in?

Yeah, it could, although running this on EVERY page you load I beleive would make Firefox load/render pages slower.
I'll try and think of another way to do so that would be faster. I might have an idea.


kstahl wrote:Very nice, Jed. I'd love to see more Gmail extensions.

One thing I've wanted for some time is an extension of the
Send Page... functionality. Something to automatically send the link to a predefined email adress with a single click.

Using the Gmail functions above it wouldn't need an external SMTP server.

Hmm, not sure what you mean. Coul you explain that idea a bit better?
Woudl you like a compose window where the body contains a link you sent to it?

If you wish, you can move discussion of my extension to this thread.

-Jed
jgordner
Posts: 3
Joined: December 8th, 2004, 3:30 pm

Firefox 1.0?

Post by jgordner »

Hi,

Was GMailCompose ever upgraded to support Firefox 1.0?
Post Reply