From e66f3f89f2df2fa5ec47870a1dca006620e1da50 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Tue, 9 Nov 2010 12:06:03 -0600 Subject: [PATCH] Add Chrome Frame support. Close requests in web.py. - Add meta tag to vnc.html and vnc_auto.html so that if Chrome Frame is installed, it is used. - Add detection to default_controls.js that shows a message with a Chrome Frame install link if the user is using a version of IE without Canvas support. - Fix web.py so that requests have their connection closed after they are completed. This has been a bug for a while but it prevents Chrome Frame from working because Chrome Frame doesn't activate until the initial request connection closes. --- include/default_controls.js | 18 ++++++++++++++++-- utils/web.py | 1 + vnc.html | 3 ++- vnc_auto.html | 3 ++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/include/default_controls.js b/include/default_controls.js index 4582682a..65cf3b0e 100644 --- a/include/default_controls.js +++ b/include/default_controls.js @@ -15,12 +15,26 @@ settingsOpen : false, // Render default controls and initialize settings menu load: function(target) { - var html, i, DC = DefaultControls, sheet, sheets, llevels; + var html = '', i, DC = DefaultControls, sheet, sheets, llevels; /* Populate the 'target' DOM element with default controls */ if (!target) { target = 'vnc'; } - html = ""; + if ((!document.createElement('canvas').getContext) && + window.ActiveXObject) { + // Suggest Chrome frame for Internet Explorer users + html += '
'; + html += ' You are using a version of Internet Explorer '; + html += ' that does not have HTML5 Canvas support. '; + html += ' To use noVNC you must use a browser with HTML5 '; + html += ' Canvas support or install '; + html += ' '; + html += ' Google Chrome Frame.'; + html += '
'; + $(target).innerHTML = html; + return; + } + html += '
'; html += '