This repository has been archived on 2022-06-15. You can view files and clone it, but cannot push or open issues/pull-requests.
selfprivacy-alps/plugins/viewhtml/public/assets/script.js

19 lines
604 B
JavaScript

var emailFrame = document.getElementById("email-frame");
if (emailFrame) {
// Resize the frame with its content
var resizeFrame = function() {
emailFrame.style.height = emailFrame.contentWindow.document.documentElement.scrollHeight + "px";
};
emailFrame.addEventListener("load", resizeFrame);
emailFrame.contentWindow.addEventListener("resize", resizeFrame);
// Polyfill in case the srcdoc attribute isn't supported
if (!emailFrame.srcdoc) {
var srcdoc = emailFrame.getAttribute("srcdoc");
var doc = emailFrame.contentWindow.document;
doc.open();
doc.write(srcdoc);
doc.close();
}
}