mirror of
https://github.com/moparisthebest/mail
synced 2025-02-07 02:20:14 -05:00
rendering mail content in 2nd sandboxed iframe works
This commit is contained in:
parent
32cc6b10e8
commit
4e6977fa1d
17
src/js/mail-content-loader.js
Normal file
17
src/js/mail-content-loader.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
(function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
console.log('Mail content frame loaded');
|
||||||
|
|
||||||
|
// set listender
|
||||||
|
window.onmessage = function(e) {
|
||||||
|
console.log('Mail content data loaded');
|
||||||
|
// insert html into sandboxed iframe
|
||||||
|
document.getElementById('mailContentDiv').innerHTML = e.data;
|
||||||
|
|
||||||
|
// get new height and post message back to parent frame
|
||||||
|
//var newHeight = document.body.scrollHeight;
|
||||||
|
//e.source.postMessage(newHeight, e.origin);
|
||||||
|
};
|
||||||
|
|
||||||
|
}());
|
16
src/mail-content.html
Normal file
16
src/mail-content.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html style="overflow-y: auto">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Mail</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
<!-- The Scripts -->
|
||||||
|
<script src="js/mail-content-loader.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="mailContentDiv"></div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user