Hacking Firefox's Send Link command?
July 9, 2007 1:51 PM   Subscribe

How do you add an email address and subject line entry to Firefox's "Send Link" context menu command?

99 percent of the time, I'm emailing myself for future reference. It'd be easier if the email address and subject line were pre-populated for me. Is there an easy way to do this, or an extension that does this?
posted by Cool Papa Bell to Computers & Internet (6 answers total) 1 user marked this as a favorite
 
Best answer: Open Firefox (program) folder.

Locate chrome\browser.jar and browse inside this file (e.g. with 7-Zip).

Locate (inside browser.jar) content\browser\browser.js and open using your text editor.

Search for sendLink : function () and modify appropriately. (I'll leave that bit up to you...)

(You could also add a second menu item, following the directions here, which is where I found out where menu items were stored in the first place.)
posted by anaelith at 5:10 PM on July 9, 2007


From here:
These steps will allow opening your desired email client when operating in Firefox and using its menus, or when activating an email link on a Firefox page:

1. In Firefox's Location (URL) Bar, enter "about:config" and then press or click "Go".
2. With the cursor in the body of the resulting page, the mouse.
3. From the pop-up menu, select "New".
4. From the next pop-up menu, select "String".
5. In the pop-up dialog box "Enter preference name", enter "network.protocol-handler.app.mailto" (without quotes), and click "OK" (You might wish to cut-and-paste that phrase to ensure correct spelling).
6. In the pop-up dialog box "? network.protocol-handler.app.mailto", enter "/usr/bin/kmail" without quotes [or the actual filesystem location of your desired email client] and click "OK". This should be the Full Path of the program, i.e. "/user/bin/kmail", not just the path "/usr/bin".
In my case the line entered looked like this.........
network.protocol-handler.app.mailto /usr/bin/kmail
Without restarting Firefox, you can test by opening or switching to another tab. from the Firefox top menu select, "File -> Send Link". Your desired email client should open.

If that doesn't happen, redo your steps, ensuring the spelling of your entries is correct, and ensure the actual Full Path of your desired mail client is entered.
and if you make the path specification a pre-formatted template document in you e-mail app of choice, it will open with your e-mail address, and whatever boilerplate text you might like it to include for white listing.
posted by paulsc at 5:18 PM on July 9, 2007


Response by poster: Search for sendLink : function () and modify appropriately. (I'll leave that bit up to you...)

Can anyone provide additional help here? I wouldn't know how to modify the code from this point.
posted by Cool Papa Bell at 9:26 PM on July 9, 2007


This extension might be helpful...
posted by hedgehog at 9:31 PM on July 9, 2007


Best answer: OK, here's how to modify it, a version that I've tested:

Follow previous directions for finding the right file.

Search for: mailtoUrl

You should find a line like thus: var mailtoUrl = "mailto:";
(Line 5664 in my version, ymmv.)

Change it so that it is thus: var mailtoUrl = "mailto:youraddress@goeshere.com";
(Note that it's just a simple insertion of your address.)

Close Firefox.

Reinsert the changed file into your browser.jar file, overwriting the old version (you did make backups, right?).

Open Firefox.

Profit.

Caveats: It'll also insert your address when you use "Send Image" from the context menu. Changing it so that it won't is the advanced course. (I.e. I am too lazy, sorry.)
posted by anaelith at 10:39 PM on July 9, 2007


Response by poster: That did it, and I was able to hack the subject line in the code there, too.

"&subject=" + "add words to subject line here " + encodeURIComponent(aSubject)

Thanks!
posted by Cool Papa Bell at 12:49 AM on July 10, 2007


« Older Can my wife collect disability and keep her...   |   :) -> :D Newer »
This thread is closed to new comments.