Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build a chrome extension to add panel to gmail windows?

I want to build a chrome extension like rapportive.com. I'm new to Chrome extensions and Gmail Content Script. Can any one please suggest how to go about this?

Currently I'm reading Google's Gadget docs.

like image 848
Naveen I Avatar asked May 23 '12 11:05

Naveen I


3 Answers

Here are some notes to get you started. There are more robust ways to build this, but this is the "hello world" of the functionality you are talking about:

  1. You will need to define a content script that you add to the context of gmail. This part is pretty easy and can work with any of the content script examples available in the Google's documentation. You should read and learn about what it means to be a content script.
  2. The content script will need to know where to look inside gmail for an email address. This address will be used to grab the social media information on the user. You message this email address from the content script to the extension's background page.
  3. The background page will need to have social media integration that the user pre-configured. Basically, you need to plug the background page into Facebook's/Twitter's/LinkedIn's APIs and use their APIs to collect information about the email address.
  4. The background page will then message the content script you added to gmail with the social media details for the email address
  5. The content script then modifies gmail's user interface to contain your social media details.

The greatest long-term challenge you will face is that gmail's layout will change unexpectedly and break email discovery or the modified UI. Both issues either require some cleverness to solve, or will require you to stay up at night wondering whether Google will suddenly break your extension.

Good luck!

like image 123
2 revs, 2 users 96% Avatar answered Oct 18 '22 20:10

2 revs, 2 users 96%


I don't know what google gadget is and link you provided gives 404 but I don't think you even need this.

What you need is a content script that is injected into gmail page where it adds a panel. So, start with reading about how to create a Chrome extension that is using content scripts.

like image 45
Konrad Dzwinel Avatar answered Oct 18 '22 20:10

Konrad Dzwinel


There is a new SDK for modifying the DOM elements in gmail: https://www.inboxsdk.com/docs/

They have a useful API for adding buttons and other elements.

like image 24
Danny Sullivan Avatar answered Oct 18 '22 20:10

Danny Sullivan