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

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.

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:
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.
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.
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.
The background page will then message the content script you added to gmail with the social media details for the email address
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!

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.

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.

Related

Properly embed Google Apps Script URL into Google Site

In Google Sites, it is possible to embed a Google Apps Script which has been published as a Web App. You just click "embed" and paste the URL of the Web App. It is possible to use the mouse to resize the iframe. However, I could not set the iframe to be of full width. Is that possible? Also, is it possible to make the whole page scrollable (instead of the iframe) when the Web App has some larger height as well? (I actually don't want to use any other functionalities of Google Sites except that it "hosts" my Google Apps Script with a custom URL and that it gets rid of the standard header warning that this Web App is not by Google).
Sorry
Unfortunately, AFAIK, this is not possible within Google sites.
I have experimented with various custom iframe HTML and CSS to try and find a workaround, but due to the way the site is rendered, it will always wrap your custom code in its own HTML and CSS. Any solution along these lines seems like it will be unreliable.
If you would like to see this specific functionality you can always submit a feature request.
My best workaround so far
Start a new site.
Delete all the elements, including the title.
Then add in your webapp embed.
It let me resize it vertically as far down as I wanted, it seems like full width since it is the only element on the page, and it doesn't present me with the warning.

Google scripts create new page elements in gmail

I apologize if this is naive, but I couldn't find a succinct answer.
Is it possible to make front end objects (buttons, etc.) appear in someone's gmail inbox using code from a Google script? Or does this require making a browser extension?
I've read the documentation and various tutorials for Google script, but it appears I can only do things like manage settings and send emails, not add entirely new page elements.
Google app scripts overview

Hyperlinks within email body work in browser but not Gmail mobile app

I've got a program that generates email reports and sends to certain recipients. The email contains a table of contents with hyperlinks to bookmarks later in the email.
This works perfectly when viewing mails in the browser, e.g. on gmail.com. However, recently something seems to have changed in the Gmail mobile app, and my hyperlinks no longer work there.
When generating the email, the link is of the form:
Section 1
and the bookmark is of the form:
<a name="section_1"/>
In the browser, the link URL appears in the form:
https://mail.google.com/mail/u/0/#m_3653008429050877336_1
In the Gmail app, however, the link appears in the form:
x-thread://-90370221/435827759917983#m_3653008429050877336_1
Any ideas what has changed, and how to make my intra-document hyperlinks work again?
Orignal Answer
This functionality is not available in gmail app. Here is the link to google forum where you can confirm:
https://productforums.google.com/forum/#!topic/gmail/CdhA_3Z1yTo
You can insert link in the gmail app (like http://www.google.com) in Gmail app which is automatically converted to clickable link when you send the message but if you want hyperlink (like "click here" and when you click on it you are directed to the link to the page) you will have to do it from your browser only. There is no option available in Gmail app to do that.
The alternate solution is to use Microsoft Outlook. Add your google account in Outlook app.
In the compose section long press in the area then you get option to add hyperlink.
Answer after discussion in chat
It seems that the problem is with the gmail app version. If you want to open links received in your gmail app so that you are redirected to the location of message in the same mail you need to have minimum version 8 of gmail app. Verified this as I was able to access the links in my gmail app as well as my browser.
Platforms on which veried the links:
Android 6.0.1 - Gmail Version: 8.1.7.182107449.release
Windows 10 - Chrome: Version 63.0.3239.132
Ubuntu 16.04 (xenial) - Firefox: Version 57.0.4
To get around the Gmail app not having an option to insert a link into text (hyperlink) on my mobile device I use another mobile app to compose the email first. Currently, the only app I have discovered to be compatible with this trick is Google Docs. I find it works for typing, formatting, inserting images and creating hyperlinks.
To upload from Google Docs into Gmail I am presently only aware of the ability to highlight the planned body of the email in Google Docs then pasting it into Gmail.
Using Google Docs I am aware of the ability to carry over changes to some features of the hypertext. Such as colour, boldness, italics, size, underline. There are possibly more customizable options available before inserting what you have composed into Gmail.
I am unaware of any tricks to create a usable hyperlink of images for use in the Gmail app.
Such a feature outside the “Signature” on Gmail desktop could prove most beneficial.
I had the same issue. I was adding hyperlinks as following
Click Here
I did it to handle the possibility of https not available on the website as links are dynamic in the email. When I changed it to following then it worked on gmail app as well.
Click Here
You can’t do it in the gmail mobile app. Sorry. Also, it matters what version you have.
I found a link on these forums with a fix. Essentially they said that if you put a span inside the link, it will fix the problem. I've not yet had a chance to test it however. According to the post:
This won't work:
Bar
But either of the following will:
<span>Bar</span>
<font>Bar</font>

Chrome Extension or Gmail Contextual Gadget?

I've been looking into adding an "extension" for gmail, this is for an application at work, basically we want to somehow integrate some options (buttons), somewhere contextual to the email that's being viewed currently.
Our users, will then be able to install extension, and the extension will establish the authorisation aspect (not sure how this is done yet) with our application.
I've so far looked into two options, not sure if I'm on the right track:
Chrome extension, that then uses gmail.js (some third party library on github), and use some jquery to search the DOM to insert a button into the reply/delete toolbar.
I understand that this would be more straight forward but would have issues with it breaking if page layout changes, or class names changes. And would also require uses to be using chrome (which is something we are fine about)
Create a gmail contextual gadget add-on, that sits at the bottom of the email, although, I'm not sure if this contextual gadget will appear at the end of the main thread of an email or inside each individual email and will require expanding?
Also correct me if I'm wrong, but are gmail contextual gadgets limited to users with Google Apps subscription in their company? I.e. we have to subscribe to google apps in our domain and deploy it on the google apps marketplace, and similarly also have the users who want to install this gadget to also be using google apps?
Thank for everyones help in advance.

How to block a specific URL in google chrome extension?

I am trying to develop a chrome extension which blocks a specific URL like gmail.com and when someone goes to gmail.com they got pop up to enter the password to continue to that website, this may decrease unauthorized way of accessing your personal sites.
If you know something about let me know, I have googled some extension and there are two-three extensions which block sites like stay focused.
The simplest way to do this is to inject a content script to all pages that should be 'protected' (you can set it up using "content_scripts"/"matches" setting in manifest.json). When script is injected and fired it should display the login dialog and handle the sign in process. You may use this code as a starting point for your extension.
BTW, I don't think that your extension can really protect anything working the way you described it. Extensions may be easily deactivated/uninstalled.