diff --git a/src/index.html b/src/index.html
index c192495..650b454 100644
--- a/src/index.html
+++ b/src/index.html
@@ -246,7 +246,7 @@
Awesome libraries used
- - Hint.css - By me :)
+ - Hint.css & Screenlog.js - By me :)
- Split.js - Nathan Cahill
- Codemirror - Marijn Haverbeke
- Emmet - Sergey Chikuyonok
diff --git a/src/script.js b/src/script.js
index cbf55d6..63d7cf0 100644
--- a/src/script.js
+++ b/src/script.js
@@ -460,6 +460,7 @@ runBtn, searchInput, consoleEl, consoleLogEl
scope.cm.html.setValue(currentItem.html);
scope.cm.css.setValue(currentItem.css);
scope.cm.js.setValue(currentItem.js);
+ scope.consoleCm.setValue('');
scope.cm.html.refresh();
scope.cm.css.refresh();
scope.cm.js.refresh();
@@ -701,6 +702,7 @@ runBtn, searchInput, consoleEl, consoleLogEl
window.previewException = function (error) {
console.error('Possible infinite loop detected.', error.stack)
+ window.onMessageFromConsole('Possible infinite loop detected.', error.stack);
}
window.onunload = function () {
saveCode('code');
@@ -1330,7 +1332,7 @@ runBtn, searchInput, consoleEl, consoleLogEl
window.onMessageFromConsole = function() {
[...arguments].forEach(function(arg) {
if (arg && arg.indexOf && arg.indexOf('filesystem:chrome-extension') !== -1) {
- arg = arg.replace(/filesystem:chrome-extension.*\.js:(\d+):(\d+)/g, 'script $1:$2');
+ arg = arg.replace(/filesystem:chrome-extension.*\.js:(\d+):*(\d*)/g, 'script $1:$2');
}
scope.consoleCm.replaceRange('\n' + arg + ' ' + ((arg + '').match(/\[object \w+]/) ? JSON.stringify(arg) : ''), { line: Infinity });
scope.consoleCm.scrollTo(0, Infinity);
diff --git a/src/style.css b/src/style.css
index 7143cca..740df45 100644
--- a/src/style.css
+++ b/src/style.css
@@ -269,7 +269,7 @@ li.CodeMirror-hint-active {
#demo-frame {
border: 0;
width: 100%;
- height: 100%;
+ height: calc(100% - 29px); /* minus minimized console height */
position: absolute;
z-index: 1;
background: white;