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:
https://medium.com/streak-developer-blog/how-to-use-the-gmail-api-in-a-chrome-extension-a272b2405b57
When I use the function getThreads(query, labels),
https://gist.github.com/omarstreak/7908035c91927abfef59

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": "27599747390-.................apps.googleusercontent.com",
"scopes": [
  "https://www.googleapis.com/auth/gmail.modify"
]

},

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 gapi.client.gmail.users.messages.list to fetch all emails that match entered keyword, but this only returns email and thread IDs, so I need to call gapi.client.gmail.users.messages.get 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": [
    "js/background.js",
    "js/client.js"]
    },
    "content_security_policy": "script-src https://.google.com 'unsafe-eval'; object-src 'self'",
    "oauth2": {
    "client_id": MY CLIENT ID,
    "scopes": [
    "scope: 'https://mail.google.com/'"
    ]
    },
    "permissions": [
    "background",
    "identity",
    "tabs",
    "https://www.googleapis.com/
    ",
    "https://.googleusercontent.com/",
    "https://mail.google.com/"
    ]
    ...

    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 https://developers.google.com/gmail/api/v1/reference/users/messages/get 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 https://developers.google.com/gmail/api/v1/reference/users/messages/attachments/get 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:

    https://mail.google.com/mail/u/0/feed/atom
    https://mail.google.com/mail/u/1/feed/atom
    https://mail.google.com/mail/u/2/feed/atom
    

    … 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.