Skip to content

Instantly share code, notes, and snippets.

@davidalpert
Created August 18, 2015 03:23
Show Gist options
  • Save davidalpert/f1132ff7d65e493f027d to your computer and use it in GitHub Desktop.
Save davidalpert/f1132ff7d65e493f027d to your computer and use it in GitHub Desktop.
Tampermonkey - Show Raw ePost Mail
// ==UserScript==
// @name Link to ePost content
// @namespace http://www.spinthemoose.com/
// @version 0.1
// @description adds a 'View Raw' link to the epost mail to view the PDF raw, which enables saving.
// @author David Alpert
// @match https://www.epost.ca/service/displayMail.a*
// @grant none
// ==/UserScript==
//
function ShowRawMail() {
if (window.jQuery == 'undefined') {
window.setTimeout(ShowRawMail, 100);
} else {
var $ = window.jQuery;
var nav = $('#mail-detail-nav ul');
nav.children().last().before('<li><a class="view-raw-btn" href="#">View Raw</a></li>');
nav.find('li a.view-raw-btn').click(function(ev) {
var src = $('#mail-main-content iframe').attr('src');
//alert(src);
window.location.href = src;
});
}
}
ShowRawMail();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment