window.GLOBALS[17] is null in the new Gmail UI while it is present for the old Gmail UI

I have a Chrome extension which uses a library called gmail.js which is sort of dependent on the window.GLOBALS[17] object from the Gmail window however in the new UI of gmail, Gmail seems to have removed the GLOBALS[17] which is equal to null now, Now I have no way to access the data that was present inside the GLOBALS[17] object, I have searched, looked and tried everything but do not seem to have an alternative to GLOBALS[17] object

The GLOBALS[17] is still available on the old Gmail UI

When seen in old Gmail UI

And is null in new Gmail UI

Wheen seen from new Gmail UI

Without this I cannot know vital information like whether the email is in conversation view and so on

Why was this removed? Is there an alternative?

Get the Message Id or thread Id immediately after sent gmail

Can I get the message id or thread id immediately after sent gmail using google script or gmail API.?

chrome extension call to gmail api

I am really new creating chrome extensions. I am trying to use Gmail API in my extension to get the Thread Id from sent email folder. I have used this tutorial:
When I use the function getThreads(query, labels),

I did not get nothing. Also when I review the background console appear this error:
Unchecked runtime.lastError while running identity.getAuthToken: OAuth2 request failed: Service responded with error: ‘bad client id: {0}’

I have created my own client_id and I put it in my manifest.

 "oauth2": {
"client_id": "",
"scopes": [


Have someone some tutorial or sample that works about using Gmail API in chrome extensions?.

Get email senders in batch from Gmail API for over 10k emails

I’m making an Chrome Extension which interacts with Gmail API.
Basically it needs to extract email senders from emails that match some keyword.
Problem is that sometimes there are over 10K emails matching this keyword.
I utilize to fetch all emails that match entered keyword, but this only returns email and thread IDs, so I need to call for each email ID retrieved from messages.list.
So there are over 10K requests to Gmail API, and I run into ERR_INSUFFICIENT_RESOURCES error in Chrome. To prevent this error, I set some timeout between calls to messages.get but then it would take ages to complete…

Is there some recommended way to get this amount of emails from Gmail API?

Chrome Extenion with Google API Basics

I am attempting to make a chrome extension and I want to integrate the Gmail API. I need to use OAuth to authenticate a user. When I am getting the OAuth credential, I am given an option based on the type of application I am making. I suspect a chrome extension would be a chrome app, as opposed to a web application, as it is running locally and not being served over the web.

Am I correct in my assumptions?

  • The API calls should be coming from background.js
  • The manifest should contain the following sections:
  • "content_scripts": [
    "js":["js/main.js", "js/background.js"]
    "background": {
    "scripts": [
    "content_security_policy": "script-src 'unsafe-eval'; object-src 'self'",
    "oauth2": {
    "client_id": MY CLIENT ID,
    "scopes": [
    "scope: ''"
    "permissions": [

    Am I missing any crucial details?

    Is there any google API which could save gmail message attachments to google drive?

    How can I save gmail message attachments to google drive. Is there any such google API?

    Is there any way we could move gmail attachments to google drive in gmail chrome extension?

    I have a gmail chrome extension which loads attachments of a specific email message. I used api to get message details which also gives the detail of attachments if available. Json response for attachment looks something like below:

    "partId": "1",
    "mimeType": "text/plain",
    "filename": "desolate-temple-64198-logs-1510662651275.txt",
    "headers": [
      "name": "Content-Type",
      "value": "text/plain; charset="US-ASCII"; name="desolate-temple-64198-logs-1510662651275.txt""
      "name": "Content-Disposition",
      "value": "attachment; filename="desolate-temple-64198-logs-1510662651275.txt""
      "name": "Content-Transfer-Encoding",
      "value": "base64"
      "name": "X-Attachment-Id",
      "value": "f_j9zmd99r0"
    "body": {
     "attachmentId": "ANGjdJ_rvtvA5vxbsywlxgUCZWlFly6-SJWFAjZmhspKuyX_9hGC7Qjr_84XkubQzNbYqTlsn4N2dCwah2F8vW8pGfADu803NjK1d-Wo_OpxXxgMt8IVGe_PENQtbeYMKcjKKe3C_oddNBEFmXPhzZRiBM6znm8rUWggLV7g6KPd8X0D2emJmrPS-KJJrsR23AQjlVvJmWoRJNJ7foH7TrQJ3Vb7HR8AL6AbOnC-0xKXFHf7C4QHOuRMA8NW9GjZDGOIkfcRL0CsnKMrKbqEK3o8GXkM6ohtniL0BM-k1qcdcERxSVQwiNgfDmcpUgQwT-KWrg66xVYHf1j8wGQgwbhaYfHkeUmCXjN_oJedlBSJv8PCGckEPHkt08M6wpyigNWXZzjcZCwNyfB5GasB",
     "size": 77518

    Now, I want to move this attachment to google drive. Is there something that I can do with attachment Id? I found that passing attachment id to this api, I could get the attachment data in base64url encoded string. But I do not see any way to move this attachment to google drive. How can I achieve this?

    Get Add my own content to gmail compose box using inboxsdk

    I am developing a chrome addon and I want to append my own content at the end to mail content using InboxSDK. I am using the following code, but it’s appending to my cursor position in Gmail Compose Box.

    var cv = event.composeView;
    cv.insertTextIntoBodyAtCursor('My Content');

    also, I want to append content before sending mail. So, How I can achieve it using InboxSDK.

    Thanks in advance

    How can i fetch the data from emails in gmail using chorme extension.?

    I want to make a chrome extension whixh can simply fetch the data (data like mail id thorugh which the mail is received, content of mail etc ) from mails in gmail. How can i do this?

    How to query how many gmail accounts are logged in?

    For a webExtension I’m trying to check the gmail inboxes by sending a xmlhttprequest to:

    … and so on for each account. I want to do this for all currently logged in accounts, but I dont know how to find out that number.

    Of course, there is a dumb way, in that I just keep incrementing the u/#/ until I loop back to /u/0/, and do a check there.

    But that is slow, since I’d then have to wait for the async to return, hopfully there will be a better way.