How does InboxSDK get the messageId in Google Inbox

813 views
Skip to first unread message

Jeppe Reinhold

unread,
Jan 24, 2018, 3:49:03 PM1/24/18
to InboxSDK
Hi. I'm in the process of making a WebExtension, that adds extra Trello functionality to Google Inbox (not Gmail).
However it is crucial to me that the extension is a fully compatible WebExtension that works with Firefox and Edge browser besides Chrome.
This means that I can't use the InboxSDK, as it only supports Chrome.

I'm trying to implement a way to get the threadId or messageId when a user clicks a button in the actions toolbar.
Do you care to tell me how InboxSDK achieves this?

Basically, how does the ThreadView.getThreadIDAsync() or MessageView.getMessageIDAsync() functions work?

I hope you'd like to help me. thanks

Chris Cowan

unread,
Jan 24, 2018, 3:58:21 PM1/24/18
to InboxSDK
Currently we make an ajax request for the "Show Original" page, and then parse the id out of the URL of the "Download Original" link, and then cache that.

Jeppe Reinhold

unread,
Jan 24, 2018, 4:12:46 PM1/24/18
to InboxSDK
Oh, that's really clever! thanks!

Then I have two follow-up questions:
- How do you get the ik-value that is needed to build the "Show Original" URL? (I can see that it is present in a InboxSDK element in the head). I can see it available a few places in the DOM, most notably a weird <script> tag in the head, with a lot of nulls etc. Do you just extract it from there?
- How do you make the actual ajax request? When I do it from the extension, it seems like it is redirected to an https://accionts.google.com/ServiceLogin.... url, which triggers an "No 'Access-Control-Allow-Origin' error.

Aleem Mawani

unread,
Jan 24, 2018, 4:16:59 PM1/24/18
to InboxSDK
is this guy trying to reverse eng the SDK? SHould he just be using the sdk?

--
You received this message because you are subscribed to the Google Groups "InboxSDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inboxsdk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/2c71592b-c165-4f2e-8085-5c0f0d277b42%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jeppe Reinhold

unread,
Jan 24, 2018, 4:30:35 PM1/24/18
to InboxSDK
I'm sorry if my questions seems offensive. As I wrote, I would love to use the SDK if it just supported other browsers than Chrome.
I'm also a firm believer of sharing knowledge, I don't see how anyone can loose anything from sharing experience and knowledge like this.

If I actually WERE trying to reverse engineer the whole SDK to do harm to you or your company, I would probably ask questions that are a bit harder than how to make a simple Ajax request. ;)

Aleem Mawani

unread,
Jan 24, 2018, 4:34:35 PM1/24/18
to Jeppe Reinhold, InboxSDK
foot in mouth. sorry about that.

thanks for clarifying. didn't see that you were trying to get this to work in firefox. we haven't done a fully exhaustive test of which apis work in firefox and which don't but we'd expect some of them to work. Is this an example of one that doesn't?

--
You received this message because you are subscribed to the Google Groups "InboxSDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inboxsdk+unsubscribe@googlegroups.com.

Jeppe Reinhold

unread,
Jan 24, 2018, 4:46:56 PM1/24/18
to InboxSDK
No problem.

I honestly don't know if it is that API that is not working. As I recall, I'm only using registerThreadButton(), getSubject() and getThreadIDAsync(), so it's probably one of those. I must also admit that I haven't tested it extensively myself either, as I just assumed the SDK only supports Chrome per the documentation.

Reply all
Reply to author
Forward
0 new messages