Created
August 18, 2015 03:23
-
-
Save davidalpert/f1132ff7d65e493f027d to your computer and use it in GitHub Desktop.
Tampermonkey - Show Raw ePost Mail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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