This is a scratch project to attempt to extract a reliable HTML href link to Google Mail messages.
The Todoist application previously created a text entity capable of opening an individual Google Mail message, for the purposes of including that message in the text body of a task. This Google Mail reference was further capable of linking to any Google Mail domain account (e.g.: [email protected]) when another Google Mail domain (e.g.: [email protected]) was used as an authenticating service for Todoist.
This behavior was highly useful and desirable, as it allowed for linking a task to a Google Mail conversation thread for later processing or clairification of the task. This could be accomplished by authenticating Todoist to the domain of a source email to be linked (e.g.: [email protected]), using the Todoist Chrome plugin to generate the text entity, and copying this enitity to any Todoist account (e.g.: [email protected]).
The added step of authenticating to the Todoist account domain for the source email address was undesirable, but not an undue burden.
This behavior has changed in Todoist. Todoist now creates a non-text DOM entity, which may not be copied through standard means. This seems to effectively disable the process for attaching an email in a Google Mail domain which differs from the Google Mail domain used to authenticate the Todoist Chrome plugin.
This is a sample same-domain email link generated by Todoist:
https://mail.google.com/mail/u/0/#inbox/140d656b8e54d660
- works for Todoist authenticated in the same Google domain
- returns "The conversation that you requested no longer exists" for a browser session authenticated in another domain
This is a sample of an email link generated by Todoist from a different authentication domain:
https://mail.google.com/a/umn.edu/#inbox/13f62a30179692eb
This is the inner most HTML hyperlink from a functioning cross-domain Todoist task:
<a onclick="return linkRedirecter(this)" target="_blank" class="ex_link" href="https://mail.google.com/a/umn.edu/#inbox/13f62a30179692eb">Web Migrations for this weekend</a>
The link includes the Google domain, and fucntions in both domain-authenticated environments.
This is the complete HTML list item from a fucntioning cross-domain Todoist task:
<li class="task_item history_item item_110881999 indent_1" id="item_110881999"> <table> <tbody> <tr> <td> <div class="div_checker"> <div class="amicheckbox"><img width="16" height="16" src="https://d3ptyyxy2at9ui.cloudfront.net/76084e29cb2cf72b320e888edc583dfb.gif" class="cmp_14_checkbox_on amicheckbox_img"></div> </div> </td> <td class="content"> <span class="date empty"></span><span>send Douglas a summary of your <img width="16" class="cmp_email_on" src="https://d3ptyyxy2at9ui.cloudfront.net/76084e29cb2cf72b320e888edc583dfb.gif"> <a onclick="return linkRedirecter(this)" target="_blank" class="ex_link" href="https://mail.google.com/a/umn.edu/#inbox/13f62a30179692eb">Web Migrations for this weekend</a><span class="clickable note_icon" style="visibility: hidden;"><img width="15" height="14" src="https://d3ptyyxy2at9ui.cloudfront.net/76084e29cb2cf72b320e888edc583dfb.gif" class="cmp_note clickable"></span></span> <div></div> </td> </tr> </tbody> </table> </li>
This is the extracted URL from a functioning link:
https://mail.google.com/a/umn.edu/#inbox/13f62a30179692eb
This is the RESTful-style URL from the location line of a Google Mail thread:
https://mail.google.com/mail/ca/u/0/#inbox/141b796e773c4f19
Note that this URL loses the encoded domain information and includes extraneous path elements. It will not function cross-domain.
The following constructed URL tests as functioning:
https://mail.google.com/a/umn.edu/#inbox/141b796e773c4f19
note: The
/a/path element is somehow relevant. Removing or replacing this portion of the path element does casues the URL to return an error.
Extract the relevant JavaScript which senses Google Mail item.
- suspicion: URL analysis of the HTTP requested