var script = document.createElement('script');script.textContent = 'localStorage.ik = GLOBALS[9]';(document.head || document.documentElement).appendChild(script);script.parentNode.removeChild(script);InboxSDK.load('1.0', 'sdk_...').then(function(sdk) {
sdk.Toolbars.registerToolbarButtonForThreadView({ title: 'Get Email Headers', section: sdk.Toolbars.SectionNames.INBOX_STATE, iconUrl: iconUrl, onClick: function() {
var originalMessageUrl = 'https://mail.google.com/mail/?ui=2&ik=' + localStorage.ik + '&view=om&th=' + window.location.hash.substr(7);
var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { var originalMessage = xhr.responseText; headersMessage = originalMessage.split('Content-Type:')[0]; console.log(headersMessage); } } xhr.open('GET', originalMessageUrl, true); xhr.send(); });
});--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/d62b1c47-c8ad-40db-9da0-4320a6b7ea66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.