如何构建一个Chrome扩展以将面板添加到gmail窗口? [英] How to build a chrome extension to add panel to gmail windows?

查看:156
本文介绍了如何构建一个Chrome扩展以将面板添加到gmail窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个像 rapportive.com 的扩展程序。我不熟悉Chrome扩展程序和Gmail内容脚本。任何人都可以建议如何去做这件事?

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?

目前我正在阅读 Google的小工具文档

推荐答案

以下是您开始的一些说明。有更强大的方法来建立这个,但这是你所谈论的功能的你好世界:

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


  1. 你需要定义添加到gmail上下文中的内容脚本。这一部分非常简单,可以使用Google文档中提供的任何内容脚本示例。您应该阅读并了解成为内容脚本意味着什么。

  2. 内容脚本需要知道gmail的电子邮件地址。此地址将用于抓取用户的社交媒体信息。您将此电子邮件地址从内容脚本发送到扩展程序的后台页面。

  3. 后台页面需要具有用户预先配置的社交媒体集成。基本上,您需要将后台页面插入到Facebook的/ Twitter的/ LinkedIn的API中,并使用它们的API来收集有关电子邮件地址的信息。

  4. 然后,后台页面将向您添加的内容脚本发送消息发送给gmail,邮件地址为社交媒体详情
  5. 然后,内容脚本修改gmail的用户界面以包含您的社交媒体详细信息。

  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.

您将面临的最大的长期挑战是gmail的布局将意外改变,并中断电子邮件发现或修改后的用户界面。这两个问题要么需要一些聪明才能解决,要么你需要在晚上熬夜想知道谷歌是否会突然中断你的扩展。

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.

祝你好运!

这篇关于如何构建一个Chrome扩展以将面板添加到gmail窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆