Hacking Gmail

(Grace) #1

110 Part II — Getting Inside Gmail


Listing 6-3(continued)

Copyright (C) 2005 Mark Pilgrim

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be
useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You can download a copy of the GNU General Public License at
http://diveintomark.org/projects/greasemonkey/COPYING
or get a free printed copy by writing to the Free Software
Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
END LICENSE BLOCK */

location.href = location.href.replace(/^http:/, ‘https:’);

//
// ChangeLog
// 2005-07-08 - 0.3 - MAP - added license block
// 2005-06-28 - 0.2 - MAP - changed GMail URL
//

This idea, rewriting URLs, can be very powerfully used. With Mark Pilgrim’s
technique of using location.href.replace, you can do this by brute force.
With the next example, “Mailto Compose in Gmail,” you will see the more radical
version of this.

MailtoComposeInGmail


Perhaps the biggest issue that hits Gmail users, if they start to use the application
as their primary e-mail tool, is that mailto:links found within e-mails do not
trigger Gmail, but rather cause your operating system to load up what it thinks is
the default e-mail application. One moment of thoughtless clicking, and Outlook
Express starts appearing all over the screen. Nausea and discomfort result.
Free download pdf