12
1 Extending Gmail Jerry Su & Ben Zotto August 2008 {jerry, ben}@xoopit.com

Xoopit: Greasemonkey + JS (SF JS #3)

Embed Size (px)

DESCRIPTION

This was a talk given by the guys at Xoopit about how they enhance Gmail with Greasemonkey hooks, and a Firefox extension to deploy custom JS

Citation preview

Page 1: Xoopit: Greasemonkey + JS (SF JS #3)

1

Extending Gmail

Jerry Su & Ben Zotto August 2008

{jerry, ben}@xoopit.com

Page 2: Xoopit: Greasemonkey + JS (SF JS #3)

2

What is Xoopit?

  A company in the Mission district.

  A web service that indexes media in email.

  A Firefox extension that brings Xoopit experience into web mail.

  Show you what we’re up to and start a conversation about building a platform on top of web email.

Page 3: Xoopit: Greasemonkey + JS (SF JS #3)

3

Xoopit demo

Page 4: Xoopit: Greasemonkey + JS (SF JS #3)

4

Creating a platform within Gmail

  Firefox extension

  Gmail Greasemonkey API

  Xoopit Javascript

Page 5: Xoopit: Greasemonkey + JS (SF JS #3)

5

Firefox extension

  Based on Greasemonkey

  Allows cross-domain XMLHttpRequests   HTTP/S directly to Xoopit web service.

  Correct cookie behavior happens due to browser.

  Inserts Xoopit JS into Gmail page (more later)

Page 6: Xoopit: Greasemonkey + JS (SF JS #3)

6

Gmail Greasemonkey API

  Google provides rudimentary API inside Gmail for scripts

  Global “gmonkey” object

  Get current view (inbox, message, settings)

  Register for view change callbacks

  Get references to some DOM locations (masthead, nav area)

  … a great start, but still pretty basic.

Page 7: Xoopit: Greasemonkey + JS (SF JS #3)

7

Xoopit Javascript

  Most of our plugin lives in JS code downloaded from our service.   Object-oriented JS: controls, data sources, controllers, etc.

  Lets us update rapidly without bothering user.

  Interacts with Firefox extension and Gmail API

Page 8: Xoopit: Greasemonkey + JS (SF JS #3)

8

Going Beyond the Gmail API

  Hook into other views: Search, Settings

  Help user find relevant content: conversation context.

  Hook into other Gmail functionality: status messages

  (Carefully) add elements to arbitrary parts of the page

  Trying to add value to the full experience.

Page 9: Xoopit: Greasemonkey + JS (SF JS #3)

9

Quick demo

  Conversation relevance

  Leveraging the Gmail experience

Page 10: Xoopit: Greasemonkey + JS (SF JS #3)

10

Living Gracefully with Gmail

…or inside any web application that you don’t own.

  Gmail is a constantly moving target: it changes.

  Know where your fragile points are and fail gracefully   Gmail’s API: pretty robust

  Listening for clicks on various UI elements: not so robust

  Namespace CSS/Javascript   CSS selectors: “xoopit-something”

  JS: one “xoopit.*” namespace

Page 11: Xoopit: Greasemonkey + JS (SF JS #3)

11

What’s Next?

  Building a platform on top of email…

  How do we all think about other developers extending our applications?

  What more can Gmail provide to add value for users?

  What about other webmail providers?

  What do you think?

Page 12: Xoopit: Greasemonkey + JS (SF JS #3)

12

Thanks!

Sign up at:

  www.xoopit.com/signup (invitation code: “jsmeetup”)

We’d love to meet you:

  Ben Zotto ([email protected])

  Jerry Su ([email protected]

References:

  Gmail Greasemonkey API:   http://code.google.com/p/gmail-greasemonkey/wiki/GmailGreasemonkey10API