From db9e2b8b789159fddf2562ca356d773d71afcc58 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Mon, 1 Sep 2014 08:34:00 +0200 Subject: IE Bug fixes ... --- simpleSigning/src/main/resources/js/pdfas.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/simpleSigning/src/main/resources/js/pdfas.js b/simpleSigning/src/main/resources/js/pdfas.js index d058bec..1017fee 100644 --- a/simpleSigning/src/main/resources/js/pdfas.js +++ b/simpleSigning/src/main/resources/js/pdfas.js @@ -301,6 +301,27 @@ var jqueryRegistration = function() { //window.addEventListener("message", pdfAs.messageHandler, false); }; +/** + * Protect window.console method calls, e.g. console is not defined on IE + * unless dev tools are open, and IE doesn't define console.debug + */ +(function() { + if (!window.console) { + window.console = {}; + } + // union of Chrome, FF, IE, and Safari console methods + var m = [ + "log", "info", "warn", "error", "debug", "trace", "dir", "group", + "groupCollapsed", "groupEnd", "time", "timeEnd", "profile", "profileEnd", + "dirxml", "assert", "count", "markTimeline", "timeStamp", "clear" + ]; + // define undefined methods as noops to prevent errors + for (var i = 0; i < m.length; i++) { + if (!window.console[m[i]]) { + window.console[m[i]] = function() {}; + } + } +})(); jqueryRegistration(); -- cgit v1.2.3