diff --git a/index.php b/index.php
index 65fe1dd..2f17a27 100644
--- a/index.php
+++ b/index.php
@@ -172,6 +172,7 @@ Color picker">
Upload...
Zip
Properties...
+ Print...
Fullscreen toggle
Logout
diff --git a/lib/ice-coder.js b/lib/ice-coder.js
index f45ca51..7bc4891 100644
--- a/lib/ice-coder.js
+++ b/lib/ice-coder.js
@@ -2001,6 +2001,20 @@ var ICEcoder = {
.replace(/'/g, "'");
},
+ // Print code of current tab
+ printCode: function() {
+ var cM, printIFrame;
+
+ cM = top.ICEcoder.getcMInstance();
+ printIFrame = top.ICEcoder.filesFrame.contentWindow.frames['fileControl'];
+ // Print page content injected into iFrame, escaped with pre and xssClean
+ printIFrame.window.document.body.innerHTML = 'ICEcoder code output'+top.ICEcoder.xssClean(cM.getValue())+'